SA-MP/saco/unkclass13.cpp
RD42 aac4f57110 [saco] Implement CUnkClass13 constructor
* Implement `CUnkClass13::RestoreDeviceObjects()`
* Update `DoInitStuff()`
2024-04-02 22:22:38 +08:00

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);
}
}