|
想要查看内容赶紧注册登陆吧!
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
#include "StdAfx.h"
#include ".\d3dtextureindex.h"
CD3DTextureIndex::CD3DTextureIndex(void)
{
m_nWidthNumber = 0;
m_nHeightNumber = 0;
}
CD3DTextureIndex::~CD3DTextureIndex(void)
{
}
//加载判断
bool CD3DTextureIndex::IsNull()
{
return CD3DTexture::IsNull();
}
//加载纹理
bool CD3DTextureIndex:oadImage( CD3DDevice * pD3DDevice, HINSTANCE hInstance, LPCTSTR pszResource, DWORD dwColorKey, int nWidthNumber, int nHeightNumber )
{
//条件判断
ASSERT(nWidthNumber > 0 && nHeightNumber>0);
//设置变量
m_nWidthNumber = nWidthNumber;
m_nHeightNumber = nHeightNumber;
//载入图片
return CD3DTexture:oadImage( pD3DDevice, hInstance, pszResource, dwColorKey );
}
//加载纹理
bool CD3DTextureIndex:oadImage( CD3DDevice * pD3DDevice, HINSTANCE hInstance, LPCTSTR pszResource, LPCTSTR pszTypeName, int nWidthNumber, int nHeightNumber )
{
//条件判断
ASSERT(nWidthNumber > 0 && nHeightNumber>0);
//设置变量
m_nWidthNumber = nWidthNumber;
m_nHeightNumber = nHeightNumber;
//载入图片
return CD3DTexture:oadImage( pD3DDevice, hInstance, pszResource, pszTypeName );
}
////加载纹理
//bool CD3DTextureIndex:oadImage( CD3DDevice * pD3DDevice, LPCTSTR pszTextureName, BOOL bCreateCache, int nWidthNumber, int nHeightNumber )
//{
// //条件判断
// ASSERT(nWidthNumber > 0 && nHeightNumber>0);
//
// //设置变量
// m_nWidthNumber = nWidthNumber;
// m_nHeightNumber = nHeightNumber;
//
// //载入图片
// return CD3DTexture:oadImage( pD3DDevice, pszTextureName, bCreateCache );
//}
//绘画图片
bool CD3DTextureIndex:rawImage( CD3DDevice * pD3DDevice, int nXDest, int nYDest, int nIndex )
{
//超过索引 画全图
if ( nIndex >= m_nWidthNumber * m_nHeightNumber )
return CD3DTexture:rawImage( pD3DDevice, nXDest, nYDest );
//设置变量
int nXSource = (nIndex%m_nWidthNumber) * GetWidth();
int nYSource = (nIndex/m_nWidthNumber) * GetHeight();
int nSourceWidth = GetWidth();
int nSourceHeight = GetHeight();
//画图
return CD3DTexture:rawImage( pD3DDevice, nXDest, nYDest, nSourceWidth, nSourceHeight, nXSource, nYSource );
}
//绘画图片
bool CD3DTextureIndex:rawImage(CD3DDevice * pD3DDevice, int nXDest, int nYDest, int nDestWidth, int nDestHeight, int nIndex)
{
//超过索引 画全图
if ( nIndex >= m_nWidthNumber * m_nHeightNumber )
return CD3DTexture:rawImage( pD3DDevice, nXDest, nYDest );
//设置变量
int nXSource = (nIndex%m_nWidthNumber) * GetWidth();
int nYSource = (nIndex/m_nWidthNumber) * GetHeight();
int nSourceWidth = GetWidth();
int nSourceHeight = GetHeight();
//画图
return CD3DTexture:rawImage( pD3DDevice, nXDest, nYDest, nDestWidth, nDestHeight, nXSource, nYSource, nSourceWidth, nSourceHeight );
}
//绘画图片
bool CD3DTextureIndex:rawImage( CD3DDevice * pD3DDevice, int nXDest, int nYDest, int nDestWidth, int nDestHeight, int nXSource, int nYSource, int nSourceWidth, int nSourceHeight )
{
//画图
return CD3DTexture:rawImage( pD3DDevice, nXDest, nYDest, nDestWidth, nDestHeight, nXSource, nYSource, nSourceWidth, nSourceHeight );
}
//绘画图片
bool CD3DTextureIndex:rawImage( CD3DDevice * pD3DDevice, int nXDest, int nYDest, BYTE cbAlpha, int nIndex )
{
//超过索引 画全图
if ( nIndex >= m_nWidthNumber * m_nHeightNumber )
return CD3DTexture:rawImage( pD3DDevice, nXDest, nYDest, cbAlpha );
//设置变量
int nXSource = (nIndex%m_nWidthNumber) * GetWidth();
int nYSource = (nIndex/m_nWidthNumber) * GetHeight();
int nSourceWidth = GetWidth();
int nSourceHeight = GetHeight();
//画图
return CD3DTexture::DrawImage( pD3DDevice, nXDest, nYDest, nSourceWidth, nSourceHeight, nXSource, nYSource, cbAlpha );
}
//绘画图片
bool CD3DTextureIndex::DrawImage(CD3DDevice * pD3DDevice, int nXDest, int nYDest, int nDestWidth, int nDestHeight, BYTE cbAlpha, int nIndex)
{
//超过索引 画全图
if ( nIndex >= m_nWidthNumber * m_nHeightNumber )
return CD3DTexture::DrawImage( pD3DDevice, nXDest, nYDest, cbAlpha );
//设置变量
int nXSource = (nIndex%m_nWidthNumber) * GetWidth();
int nYSource = (nIndex/m_nWidthNumber) * GetHeight();
int nSourceWidth = GetWidth();
int nSourceHeight = GetHeight();
//画图
return CD3DTexture::DrawImage( pD3DDevice, nXDest, nYDest, nDestWidth, nDestHeight, nXSource, nYSource, nSourceWidth, nSourceHeight, cbAlpha );
}
//绘画图片
bool CD3DTextureIndex::DrawImage( CD3DDevice * pD3DDevice, int nXDest, int nYDest, int nDestWidth, int nDestHeight, int nXSource, int nYSource, int nSourceWidth, int nSourceHeight, BYTE cbAlpha )
{
//画图
return CD3DTexture::DrawImage( pD3DDevice, nXDest, nYDest, nDestWidth, nDestHeight, nXSource, nYSource, nSourceWidth, nSourceHeight, cbAlpha );
}
//绘画图片
bool CD3DTextureIndex::DrawImage( CD3DDevice * pD3DDevice, CPoint ptRotationOffset, FLOAT fRadian, CHAR chDirection, int nXDest, int nYDest, int nIndex )
{
//超过索引 画全图
if ( nIndex >= m_nWidthNumber * m_nHeightNumber )
return CD3DTexture::DrawImage( pD3DDevice, ptRotationOffset, fRadian, chDirection, nXDest, nYDest );
//设置变量
int nXSource = (nIndex%m_nWidthNumber) * GetWidth();
int nYSource = (nIndex/m_nWidthNumber) * GetHeight();
int nSourceWidth = GetWidth();
int nSourceHeight = GetHeight();
//画图
return CD3DTexture::DrawImage( pD3DDevice, ptRotationOffset, fRadian, chDirection, nXDest, nYDest, nSourceWidth, nSourceHeight, nXSource, nYSource );
}
//绘画图片
bool CD3DTextureIndex::DrawImage(CD3DDevice * pD3DDevice, CPoint ptRotationOffset, FLOAT fRadian, CHAR chDirection, int nXDest, int nYDest, int nDestWidth, int nDestHeight, int nIndex)
{
//超过索引 画全图
if ( nIndex >= m_nWidthNumber * m_nHeightNumber )
return CD3DTexture::DrawImage( pD3DDevice, ptRotationOffset, fRadian, chDirection, nXDest, nYDest );
//设置变量
int nXSource = (nIndex%m_nWidthNumber) * GetWidth();
int nYSource = (nIndex/m_nWidthNumber) * GetHeight();
int nSourceWidth = GetWidth();
int nSourceHeight = GetHeight();
//画图
return CD3DTexture::DrawImage( pD3DDevice, ptRotationOffset, fRadian, chDirection, nXDest, nYDest, nDestWidth, nDestHeight, nXSource, nYSource, nSourceWidth, nSourceHeight );
}
//绘画图片
bool CD3DTextureIndex::DrawImage( CD3DDevice * pD3DDevice, CPoint ptRotationOffset, FLOAT fRadian, CHAR chDirection, int nXDest, int nYDest, int nDestWidth, int nDestHeight, int nXSource, int nYSource, int nSourceWidth, int nSourceHeight )
{
//画图
return CD3DTexture::DrawImage( pD3DDevice, ptRotationOffset, fRadian, chDirection, nXDest, nYDest, nDestWidth, nDestHeight, nXSource, nYSource, nSourceWidth, nSourceHeight );
}
//绘画图片
bool CD3DTextureIndex::DrawImage( CD3DDevice * pD3DDevice, CPoint ptRotationOffset, FLOAT fRadian, CHAR chDirection, int nXDest, int nYDest, BYTE cbAlpha, int nIndex )
{
//超过索引 画全图
if ( nIndex >= m_nWidthNumber * m_nHeightNumber )
return CD3DTexture::DrawImage( pD3DDevice, ptRotationOffset, fRadian, chDirection, nXDest, nYDest, cbAlpha );
//设置变量
int nXSource = (nIndex%m_nWidthNumber) * GetWidth();
int nYSource = (nIndex/m_nWidthNumber) * GetHeight();
int nSourceWidth = GetWidth();
int nSourceHeight = GetHeight();
//画图
return CD3DTexture::DrawImage( pD3DDevice, ptRotationOffset, fRadian, chDirection, nXDest, nYDest, nSourceWidth, nSourceHeight, nXSource, nYSource, cbAlpha );
}
//绘画图片
bool CD3DTextureIndex::DrawImage(CD3DDevice * pD3DDevice, CPoint ptRotationOffset, FLOAT fRadian, CHAR chDirection, int nXDest, int nYDest, int nDestWidth, int nDestHeight, BYTE cbAlpha, int nIndex)
{
//超过索引 画全图
if ( nIndex >= m_nWidthNumber * m_nHeightNumber )
return CD3DTexture::DrawImage( pD3DDevice, ptRotationOffset, fRadian, chDirection, nXDest, nYDest, cbAlpha );
//设置变量
int nXSource = (nIndex%m_nWidthNumber) * GetWidth();
int nYSource = (nIndex/m_nWidthNumber) * GetHeight();
int nSourceWidth = GetWidth();
int nSourceHeight = GetHeight();
//画图
return CD3DTexture::DrawImage( pD3DDevice, ptRotationOffset, fRadian, chDirection, nXDest, nYDest, nDestWidth, nDestHeight, nXSource, nYSource, nSourceWidth, nSourceHeight, cbAlpha );
}
//绘画图片
bool CD3DTextureIndex::DrawImage( CD3DDevice * pD3DDevice, CPoint ptRotationOffset, FLOAT fRadian, CHAR chDirection, int nXDest, int nYDest, int nDestWidth, int nDestHeight, int nXSource, int nYSource, int nSourceWidth, int nSourceHeight, BYTE cbAlpha )
{
//画图
return CD3DTexture::DrawImage( pD3DDevice, ptRotationOffset, fRadian, chDirection, nXDest, nYDest, nDestWidth, nDestHeight, nXSource, nYSource, nSourceWidth, nSourceHeight, cbAlpha );
}
//-------------------------------------------------------------------------------------
//滤色函数
//
//绘画滤色图片
bool CD3DTextureIndex::DrawColourFilterImage( CD3DDevice * pD3DDevice, int nXDest, int nYDest, int nIndex )
{
//超过索引 画全图
if ( nIndex >= m_nWidthNumber * m_nHeightNumber )
return CD3DTexture::DrawImage( pD3DDevice, nXDest, nYDest );
//设置变量
int nXSource = (nIndex%m_nWidthNumber) * GetWidth();
int nYSource = (nIndex/m_nWidthNumber) * GetHeight();
int nSourceWidth = GetWidth();
int nSourceHeight = GetHeight();
//画图
return CD3DTexture::DrawImage( pD3DDevice, nXDest, nYDest, nSourceWidth, nSourceHeight, nXSource, nYSource );
}
//绘画滤色图片
bool CD3DTextureIndex::DrawColourFilterImage(CD3DDevice * pD3DDevice, int nXDest, int nYDest, int nDestWidth, int nDestHeight, int nIndex)
{
//超过索引 画全图
if ( nIndex >= m_nWidthNumber * m_nHeightNumber )
return CD3DTexture::DrawImage( pD3DDevice, nXDest, nYDest );
//设置变量
int nXSource = (nIndex%m_nWidthNumber) * GetWidth();
int nYSource = (nIndex/m_nWidthNumber) * GetHeight();
int nSourceWidth = GetWidth();
int nSourceHeight = GetHeight();
//画图
return CD3DTexture::DrawImage( pD3DDevice, nXDest, nYDest, nDestWidth, nDestHeight, nXSource, nYSource, nSourceWidth, nSourceHeight );
}
//绘画滤色图片
bool CD3DTextureIndex::DrawColourFilterImage( CD3DDevice * pD3DDevice, int nXDest, int nYDest, int nDestWidth, int nDestHeight, int nXSource, int nYSource, int nSourceWidth, int nSourceHeight )
{
//画图
return CD3DTexture::DrawImage( pD3DDevice, nXDest, nYDest, nDestWidth, nDestHeight, nXSource, nYSource, nSourceWidth, nSourceHeight );
}
//绘画滤色图片
bool CD3DTextureIndex::DrawColourFilterImage( CD3DDevice * pD3DDevice, int nXDest, int nYDest, BYTE cbAlpha, int nIndex )
{
//超过索引 画全图
if ( nIndex >= m_nWidthNumber * m_nHeightNumber )
return CD3DTexture::DrawImage( pD3DDevice, nXDest, nYDest, cbAlpha );
//设置变量
int nXSource = (nIndex%m_nWidthNumber) * GetWidth();
int nYSource = (nIndex/m_nWidthNumber) * GetHeight();
int nSourceWidth = GetWidth();
int nSourceHeight = GetHeight();
//画图
return CD3DTexture::DrawImage( pD3DDevice, nXDest, nYDest, nSourceWidth, nSourceHeight, nXSource, nYSource, cbAlpha );
}
//绘画滤色图片
bool CD3DTextureIndex::DrawColourFilterImage(CD3DDevice * pD3DDevice, int nXDest, int nYDest, int nDestWidth, int nDestHeight, BYTE cbAlpha, int nIndex)
{
//超过索引 画全图
if ( nIndex >= m_nWidthNumber * m_nHeightNumber )
return CD3DTexture::DrawImage( pD3DDevice, nXDest, nYDest, cbAlpha );
//设置变量
int nXSource = (nIndex%m_nWidthNumber) * GetWidth();
int nYSource = (nIndex/m_nWidthNumber) * GetHeight();
int nSourceWidth = GetWidth();
int nSourceHeight = GetHeight();
//画图
return CD3DTexture::DrawImage( pD3DDevice, nXDest, nYDest, nDestWidth, nDestHeight, nXSource, nYSource, nSourceWidth, nSourceHeight, cbAlpha );
}
//绘画滤色图片
bool CD3DTextureIndex::DrawColourFilterImage( CD3DDevice * pD3DDevice, int nXDest, int nYDest, int nDestWidth, int nDestHeight, int nXSource, int nYSource, int nSourceWidth, int nSourceHeight, BYTE cbAlpha )
{
//画图
return CD3DTexture::DrawImage( pD3DDevice, nXDest, nYDest, nDestWidth, nDestHeight, nXSource, nYSource, nSourceWidth, nSourceHeight, cbAlpha );
}
//绘画滤色图片
bool CD3DTextureIndex::DrawColourFilterImage( CD3DDevice * pD3DDevice, CPoint ptRotationOffset, FLOAT fRadian, CHAR chDirection, int nXDest, int nYDest, int nIndex )
{
//超过索引 画全图
if ( nIndex >= m_nWidthNumber * m_nHeightNumber )
return CD3DTexture::DrawImage( pD3DDevice, ptRotationOffset, fRadian, chDirection, nXDest, nYDest );
//设置变量
int nXSource = (nIndex%m_nWidthNumber) * GetWidth();
int nYSource = (nIndex/m_nWidthNumber) * GetHeight();
int nSourceWidth = GetWidth();
int nSourceHeight = GetHeight();
//画图
return CD3DTexture::DrawImage( pD3DDevice, ptRotationOffset, fRadian, chDirection, nXDest, nYDest, nSourceWidth, nSourceHeight, nXSource, nYSource );
}
//绘画滤色图片
bool CD3DTextureIndex::DrawColourFilterImage(CD3DDevice * pD3DDevice, CPoint ptRotationOffset, FLOAT fRadian, CHAR chDirection, int nXDest, int nYDest, int nDestWidth, int nDestHeight, int nIndex)
{
//超过索引 画全图
if ( nIndex >= m_nWidthNumber * m_nHeightNumber )
return CD3DTexture::DrawImage( pD3DDevice, ptRotationOffset, fRadian, chDirection, nXDest, nYDest );
//设置变量
int nXSource = (nIndex%m_nWidthNumber) * GetWidth();
int nYSource = (nIndex/m_nWidthNumber) * GetHeight();
int nSourceWidth = GetWidth();
int nSourceHeight = GetHeight();
//画图
return CD3DTexture::DrawImage( pD3DDevice, ptRotationOffset, fRadian, chDirection, nXDest, nYDest, nDestWidth, nDestHeight, nXSource, nYSource, nSourceWidth, nSourceHeight );
}
//绘画滤色图片
bool CD3DTextureIndex::DrawColourFilterImage( CD3DDevice * pD3DDevice, CPoint ptRotationOffset, FLOAT fRadian, CHAR chDirection, int nXDest, int nYDest, int nDestWidth, int nDestHeight, int nXSource, int nYSource, int nSourceWidth, int nSourceHeight )
{
//画图
return CD3DTexture::DrawImage( pD3DDevice, ptRotationOffset, fRadian, chDirection, nXDest, nYDest, nDestWidth, nDestHeight, nXSource, nYSource, nSourceWidth, nSourceHeight );
}
//绘画滤色图片
bool CD3DTextureIndex::DrawColourFilterImage( CD3DDevice * pD3DDevice, CPoint ptRotationOffset, FLOAT fRadian, CHAR chDirection, int nXDest, int nYDest, BYTE cbAlpha, int nIndex )
{
//超过索引 画全图
if ( nIndex >= m_nWidthNumber * m_nHeightNumber )
return CD3DTexture::DrawImage( pD3DDevice, ptRotationOffset, fRadian, chDirection, nXDest, nYDest, cbAlpha );
//设置变量
int nXSource = (nIndex%m_nWidthNumber) * GetWidth();
int nYSource = (nIndex/m_nWidthNumber) * GetHeight();
int nSourceWidth = GetWidth();
int nSourceHeight = GetHeight();
//画图
return CD3DTexture::DrawImage( pD3DDevice, ptRotationOffset, fRadian, chDirection, nXDest, nYDest, nSourceWidth, nSourceHeight, nXSource, nYSource, cbAlpha );
}
//绘画滤色图片
bool CD3DTextureIndex::DrawColourFilterImage(CD3DDevice * pD3DDevice, CPoint ptRotationOffset, FLOAT fRadian, CHAR chDirection, int nXDest, int nYDest, int nDestWidth, int nDestHeight, BYTE cbAlpha, int nIndex)
{
//超过索引 画全图
if ( nIndex >= m_nWidthNumber * m_nHeightNumber )
return CD3DTexture::DrawImage( pD3DDevice, ptRotationOffset, fRadian, chDirection, nXDest, nYDest, cbAlpha );
//设置变量
int nXSource = (nIndex%m_nWidthNumber) * GetWidth();
int nYSource = (nIndex/m_nWidthNumber) * GetHeight();
int nSourceWidth = GetWidth();
int nSourceHeight = GetHeight();
//画图
return CD3DTexture::DrawImage( pD3DDevice, ptRotationOffset, fRadian, chDirection, nXDest, nYDest, nDestWidth, nDestHeight, nXSource, nYSource, nSourceWidth, nSourceHeight, cbAlpha );
}
//绘画滤色图片
bool CD3DTextureIndex::DrawColourFilterImage( CD3DDevice * pD3DDevice, CPoint ptRotationOffset, FLOAT fRadian, CHAR chDirection, int nXDest, int nYDest, int nDestWidth, int nDestHeight, int nXSource, int nYSource, int nSourceWidth, int nSourceHeight, BYTE cbAlpha )
{
//画图
return CD3DTexture::DrawImage( pD3DDevice, ptRotationOffset, fRadian, chDirection, nXDest, nYDest, nDestWidth, nDestHeight, nXSource, nYSource, nSourceWidth, nSourceHeight, cbAlpha );
}
|
|