mirror of
https://github.com/dashr9230/SA-MP.git
synced 2025-09-19 20:26:14 +08:00
[saco] Implement CUnkClass13 constructor
* Implement `CUnkClass13::RestoreDeviceObjects()` * Update `DoInitStuff()`
This commit is contained in:
31
saco/unkclass13.cpp
Normal file
31
saco/unkclass13.cpp
Normal file
@ -0,0 +1,31 @@
|
||||
|
||||
#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);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user