forked from Tr0n/client
Upgraded to DirectX 9
This commit is contained in:
@ -45,7 +45,7 @@ bool CGraphicImageTexture::CreateDeviceObjects()
|
||||
if (m_stFileName.empty())
|
||||
{
|
||||
// <20><>Ʈ <20>ؽ<EFBFBD><D8BD><EFBFBD>
|
||||
if (FAILED(ms_lpd3dDevice->CreateTexture(m_width, m_height, 1, 0, m_d3dFmt, D3DPOOL_MANAGED, &m_lpd3dTexture)))
|
||||
if (FAILED(ms_lpd3dDevice->CreateTexture(m_width, m_height, 1, 0, m_d3dFmt, D3DPOOL_MANAGED, &m_lpd3dTexture, NULL)))
|
||||
return false;
|
||||
}
|
||||
else
|
||||
@ -96,7 +96,7 @@ bool CGraphicImageTexture::CreateDDSTexture(CDXTCImage & image, const BYTE * /*c
|
||||
int mipmapCount = image.m_dwMipMapCount == 0 ? 1 : image.m_dwMipMapCount;
|
||||
|
||||
D3DFORMAT format;
|
||||
LPDIRECT3DTEXTURE8 lpd3dTexture;
|
||||
LPDIRECT3DTEXTURE9 lpd3dTexture;
|
||||
D3DPOOL pool = ms_bSupportDXT ? D3DPOOL_MANAGED : D3DPOOL_SCRATCH;;
|
||||
|
||||
if(image.m_CompFormat == PF_DXT5)
|
||||
@ -173,13 +173,13 @@ bool CGraphicImageTexture::CreateDDSTexture(CDXTCImage & image, const BYTE * /*c
|
||||
return false;
|
||||
}
|
||||
|
||||
IDirect3DTexture8* pkTexSrc=lpd3dTexture;
|
||||
IDirect3DTexture8* pkTexDst=m_lpd3dTexture;
|
||||
IDirect3DTexture9* pkTexSrc = lpd3dTexture;
|
||||
IDirect3DTexture9* pkTexDst = m_lpd3dTexture;
|
||||
|
||||
for(int i=0; i<mipmapCount; ++i) {
|
||||
|
||||
IDirect3DSurface8* ppsSrc = NULL;
|
||||
IDirect3DSurface8* ppsDst = NULL;
|
||||
IDirect3DSurface9* ppsSrc = NULL;
|
||||
IDirect3DSurface9* ppsDst = NULL;
|
||||
|
||||
if (SUCCEEDED(pkTexSrc->GetSurfaceLevel(i, &ppsSrc)))
|
||||
{
|
||||
@ -216,22 +216,12 @@ bool CGraphicImageTexture::CreateFromMemoryFile(UINT bufSize, const void * c_pvB
|
||||
else
|
||||
{
|
||||
D3DXIMAGE_INFO imageInfo;
|
||||
if (FAILED(D3DXCreateTextureFromFileInMemoryEx(
|
||||
ms_lpd3dDevice,
|
||||
c_pvBuf,
|
||||
bufSize,
|
||||
D3DX_DEFAULT,
|
||||
D3DX_DEFAULT,
|
||||
D3DX_DEFAULT,
|
||||
0,
|
||||
d3dFmt,
|
||||
D3DPOOL_MANAGED,
|
||||
dwFilter,
|
||||
dwFilter,
|
||||
0xffff00ff,
|
||||
&imageInfo,
|
||||
NULL,
|
||||
&m_lpd3dTexture)))
|
||||
if (FAILED(D3DXGetImageInfoFromFileInMemory(c_pvBuf, bufSize, &imageInfo)))
|
||||
{
|
||||
TraceError("CreateFromMemoryFile: Cannot GetImageInfo from texture");
|
||||
return false;
|
||||
}
|
||||
if (FAILED(D3DXCreateTextureFromFileInMemoryEx(ms_lpd3dDevice, c_pvBuf, bufSize, imageInfo.Width, imageInfo.Height, D3DX_DEFAULT, 0, d3dFmt, D3DPOOL_MANAGED, dwFilter, dwFilter, 0xffff00ff, NULL, NULL, &m_lpd3dTexture)))
|
||||
{
|
||||
TraceError("CreateFromMemoryFile: Cannot create texture");
|
||||
return false;
|
||||
@ -261,8 +251,8 @@ bool CGraphicImageTexture::CreateFromMemoryFile(UINT bufSize, const void * c_pvB
|
||||
if (IsLowTextureMemory())
|
||||
if (uTexBias || format!=imageInfo.Format)
|
||||
{
|
||||
IDirect3DTexture8* pkTexSrc=m_lpd3dTexture;
|
||||
IDirect3DTexture8* pkTexDst;
|
||||
IDirect3DTexture9* pkTexSrc=m_lpd3dTexture;
|
||||
IDirect3DTexture9* pkTexDst;
|
||||
|
||||
|
||||
if (SUCCEEDED(D3DXCreateTexture(
|
||||
@ -279,8 +269,8 @@ bool CGraphicImageTexture::CreateFromMemoryFile(UINT bufSize, const void * c_pvB
|
||||
|
||||
for(int i=0; i<imageInfo.MipLevels; ++i) {
|
||||
|
||||
IDirect3DSurface8* ppsSrc = NULL;
|
||||
IDirect3DSurface8* ppsDst = NULL;
|
||||
IDirect3DSurface9* ppsSrc = NULL;
|
||||
IDirect3DSurface9* ppsDst = NULL;
|
||||
|
||||
if (SUCCEEDED(pkTexSrc->GetSurfaceLevel(i, &ppsSrc)))
|
||||
{
|
||||
|
Reference in New Issue
Block a user