mirror of
https://github.com/dashr9230/SA-MP.git
synced 2024-11-23 22:39:39 +00:00
aac4f57110
* Implement `CUnkClass13::RestoreDeviceObjects()` * Update `DoInitStuff()`
31 lines
725 B
C++
31 lines
725 B
C++
|
|
#include "main.h"
|
|
|
|
CUnkClass13::CUnkClass13(IDirect3DDevice9 *pD3DDevice)
|
|
{
|
|
field_20 = 0;
|
|
m_pD3DSurface = NULL;
|
|
m_pD3DTexture = NULL;
|
|
m_pD3DRenderToSurface = NULL;
|
|
m_pD3DDevice = pD3DDevice;
|
|
|
|
RestoreDeviceObjects();
|
|
}
|
|
|
|
void CUnkClass13::RestoreDeviceObjects()
|
|
{
|
|
m_pD3DDevice->GetDisplayMode(0, &m_DisplayMode);
|
|
|
|
HRESULT hr = D3DXCreateTexture(m_pD3DDevice, 128, 32, 1,
|
|
D3DUSAGE_RENDERTARGET, m_DisplayMode.Format, D3DPOOL_DEFAULT, &m_pD3DTexture);
|
|
if(SUCCEEDED(hr))
|
|
{
|
|
D3DSURFACE_DESC desc;
|
|
|
|
m_pD3DTexture->GetSurfaceLevel(0, &m_pD3DSurface);
|
|
m_pD3DSurface->GetDesc(&desc);
|
|
|
|
D3DXCreateRenderToSurface(m_pD3DDevice, desc.Width, desc.Height,
|
|
desc.Format, TRUE, D3DFMT_D16, &m_pD3DRenderToSurface);
|
|
}
|
|
} |