Split the D3D8Interceptor code into separate files
This commit is contained in:
parent
b82c83c188
commit
b9c17123ea
|
@ -102,6 +102,18 @@
|
|||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\d3d8Wrapper.cpp" />
|
||||
<ClCompile Include="..\Direct3D8Device8Functions.cpp" />
|
||||
<ClCompile Include="..\Direct3D8Functions.cpp" />
|
||||
<ClCompile Include="..\Direct3DBaseTextureFunctions.cpp" />
|
||||
<ClCompile Include="..\Direct3DCubeTexture8Functions.cpp" />
|
||||
<ClCompile Include="..\Direct3DIndexBuffer8Functions.cpp" />
|
||||
<ClCompile Include="..\Direct3DResource8Functions.cpp" />
|
||||
<ClCompile Include="..\Direct3DSurface8Functions.cpp" />
|
||||
<ClCompile Include="..\Direct3DSwapChain8Functions.cpp" />
|
||||
<ClCompile Include="..\Direct3DTexture8Functions.cpp" />
|
||||
<ClCompile Include="..\Direct3DVertexBuffer8Functions.cpp" />
|
||||
<ClCompile Include="..\Direct3DVolume8Functions.cpp" />
|
||||
<ClCompile Include="..\Direct3DVolumeTexture8Functions.cpp" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,185 @@
|
|||
#include "d3d8Wrapper.h"
|
||||
|
||||
extern "C"
|
||||
{
|
||||
namespace D3D8Wrapper
|
||||
{
|
||||
ThreadSafePointerSet IDirect3D8::m_List;
|
||||
|
||||
D3D8Wrapper::IDirect3D8* D3D8Wrapper::IDirect3D8::GetDirect3D(D3D8Base::IDirect3D8* pD3D)
|
||||
{
|
||||
D3D8Wrapper::IDirect3D8* p = (D3D8Wrapper::IDirect3D8*) m_List.GetDataPtr(pD3D);
|
||||
if( p == NULL )
|
||||
{
|
||||
p = new D3D8Wrapper::IDirect3D8(pD3D);
|
||||
m_List.AddMember(pD3D,p);
|
||||
return p;
|
||||
}
|
||||
|
||||
p->m_ulRef++;
|
||||
return p;
|
||||
}
|
||||
|
||||
|
||||
STDMETHODIMP_(ULONG) D3D8Wrapper::IDirect3D8::Release(THIS)
|
||||
{
|
||||
|
||||
m_pUnk->Release();
|
||||
|
||||
ULONG ulRef = --m_ulRef;
|
||||
|
||||
if(ulRef == 0)
|
||||
{
|
||||
m_List.DeleteMember(GetDirect3D8());
|
||||
delete this;
|
||||
return 0L;
|
||||
}
|
||||
return ulRef;
|
||||
}
|
||||
|
||||
D3D8Wrapper::IDirect3D8::IDirect3D8(D3D8Base::IDirect3D8* real) : D3D8Wrapper::IDirect3DUnknown((IUnknown*) real)
|
||||
{
|
||||
m_pD3D = real;
|
||||
}
|
||||
|
||||
STDMETHODIMP D3D8Wrapper::IDirect3D8::GetAdapterDisplayMode(THIS_ UINT Adapter,D3D8Base::D3DDISPLAYMODE* pMode)
|
||||
{
|
||||
LOG("displaymode");
|
||||
HRESULT hr = m_pD3D->GetAdapterDisplayMode(Adapter, pMode);
|
||||
return hr;
|
||||
}
|
||||
|
||||
|
||||
/*** IDirect3D8 methods ***/
|
||||
|
||||
STDMETHODIMP D3D8Wrapper::IDirect3D8::RegisterSoftwareDevice(void* pInitializeFunction)
|
||||
{
|
||||
LOG("RegisterSoftwareDevice");
|
||||
HRESULT hr = m_pD3D->RegisterSoftwareDevice(pInitializeFunction);
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
STDMETHODIMP_(UINT) D3D8Wrapper::IDirect3D8::GetAdapterCount(THIS)
|
||||
{
|
||||
LOG("GetAdapterCount");
|
||||
return m_pD3D->GetAdapterCount();
|
||||
}
|
||||
|
||||
|
||||
STDMETHODIMP D3D8Wrapper::IDirect3D8::GetAdapterIdentifier(UINT Adapter,DWORD Flags,D3D8Base::D3DADAPTER_IDENTIFIER8* pIdentifier)
|
||||
{
|
||||
LOG("GetAdapterIdentifier");
|
||||
HRESULT hr = m_pD3D->GetAdapterIdentifier(Adapter,Flags,pIdentifier);
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
|
||||
STDMETHODIMP_(UINT) D3D8Wrapper::IDirect3D8::GetAdapterModeCount(UINT Adapter)
|
||||
{
|
||||
LOG("GetAdapterModeCount");
|
||||
return m_pD3D->GetAdapterModeCount(Adapter);
|
||||
}
|
||||
|
||||
STDMETHODIMP D3D8Wrapper::IDirect3D8::EnumAdapterModes(UINT Adapter,UINT Mode,D3D8Base::D3DDISPLAYMODE* pMode)
|
||||
{
|
||||
LOG("EnumAdapterModes");
|
||||
HRESULT hr = m_pD3D->EnumAdapterModes(Adapter,Mode,pMode);
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
|
||||
STDMETHODIMP D3D8Wrapper::IDirect3D8::CheckDeviceType(UINT Adapter,D3D8Base::D3DDEVTYPE CheckType,D3D8Base::D3DFORMAT DisplayFormat,D3D8Base::D3DFORMAT BackBufferFormat,BOOL Windowed)
|
||||
{
|
||||
LOG("CheckDeviceType");
|
||||
HRESULT hr = m_pD3D->CheckDeviceType(Adapter,CheckType,DisplayFormat,BackBufferFormat,Windowed);
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
|
||||
STDMETHODIMP D3D8Wrapper::IDirect3D8::CheckDeviceFormat(UINT Adapter,D3D8Base::D3DDEVTYPE DeviceType,D3D8Base::D3DFORMAT AdapterFormat,DWORD Usage,D3D8Base::D3DRESOURCETYPE RType,D3D8Base::D3DFORMAT CheckFormat)
|
||||
{
|
||||
LOG("CheckDeviceFormat");
|
||||
HRESULT hr = m_pD3D->CheckDeviceFormat(Adapter,DeviceType,AdapterFormat,Usage,RType,CheckFormat);
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
|
||||
STDMETHODIMP D3D8Wrapper::IDirect3D8::CheckDeviceMultiSampleType(UINT Adapter,D3D8Base::D3DDEVTYPE DeviceType,D3D8Base::D3DFORMAT SurfaceFormat,BOOL Windowed,D3D8Base::D3DMULTISAMPLE_TYPE MultiSampleType)
|
||||
{
|
||||
LOG("CheckDeviceMultiSampleType");
|
||||
HRESULT hr = m_pD3D->CheckDeviceMultiSampleType(Adapter,DeviceType,SurfaceFormat,Windowed,MultiSampleType);
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
|
||||
STDMETHODIMP D3D8Wrapper::IDirect3D8::CheckDepthStencilMatch(UINT Adapter,D3D8Base::D3DDEVTYPE DeviceType,D3D8Base::D3DFORMAT AdapterFormat,D3D8Base::D3DFORMAT RenderTargetFormat,D3D8Base::D3DFORMAT DepthStencilFormat)
|
||||
{
|
||||
LOG("CheckDepthStencilMatch");
|
||||
HRESULT hr = m_pD3D->CheckDepthStencilMatch(Adapter,DeviceType,AdapterFormat,RenderTargetFormat,DepthStencilFormat);
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
STDMETHODIMP D3D8Wrapper::IDirect3D8::GetDeviceCaps(UINT Adapter,D3D8Base::D3DDEVTYPE DeviceType,D3D8Base::D3DCAPS8* pCaps)
|
||||
{
|
||||
LOG("GetDeviceCaps");
|
||||
HRESULT hr = m_pD3D->GetDeviceCaps(Adapter,DeviceType,pCaps);
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
STDMETHODIMP_(HMONITOR) D3D8Wrapper::IDirect3D8::GetAdapterMonitor(UINT Adapter)
|
||||
{
|
||||
LOG("GetAdapterMonitor");
|
||||
return m_pD3D->GetAdapterMonitor(Adapter);
|
||||
}
|
||||
|
||||
|
||||
STDMETHODIMP D3D8Wrapper::IDirect3D8::CreateDevice(UINT Adapter,D3D8Base::D3DDEVTYPE DeviceType,HWND hFocusWindow,DWORD BehaviorFlags,D3D8Base::D3DPRESENT_PARAMETERS* pPresentationParameters,D3D8Wrapper::IDirect3DDevice8** ppReturnedDeviceInterface)
|
||||
{
|
||||
LOG("createdevice");
|
||||
LOG(pPresentationParameters);
|
||||
if (pPresentationParameters != NULL)
|
||||
{
|
||||
LOG(pPresentationParameters->BackBufferWidth);
|
||||
LOG(pPresentationParameters->BackBufferHeight);
|
||||
LOG(pPresentationParameters->BackBufferFormat);
|
||||
LOG(pPresentationParameters->BackBufferCount);
|
||||
LOG(pPresentationParameters->MultiSampleType);
|
||||
LOG(pPresentationParameters->SwapEffect);
|
||||
LOG(pPresentationParameters->hDeviceWindow);
|
||||
LOG(pPresentationParameters->Windowed);
|
||||
LOG(pPresentationParameters->EnableAutoDepthStencil);
|
||||
LOG(pPresentationParameters->Flags);
|
||||
LOG(pPresentationParameters->FullScreen_RefreshRateInHz);
|
||||
LOG(pPresentationParameters->FullScreen_PresentationInterval);
|
||||
}
|
||||
|
||||
D3D8Base::IDirect3DDevice8* fd = NULL;
|
||||
|
||||
D3D8Base::IDirect3DDevice8** fdp = &fd;
|
||||
|
||||
LOG(fd);
|
||||
|
||||
HRESULT hr = m_pD3D->CreateDevice(Adapter,DeviceType,hFocusWindow,BehaviorFlags,pPresentationParameters,fdp);//(D3D8Base::IDirect3DDevice8**)ppReturnedDeviceInterface);
|
||||
LOG(fd);
|
||||
LOG(hr);
|
||||
|
||||
|
||||
D3D8Wrapper::IDirect3DDevice8* f = D3D8Wrapper::IDirect3DDevice8::GetDirect3DDevice(fd);
|
||||
|
||||
*ppReturnedDeviceInterface = f;//(D3D8Wrapper::IDirect3DDevice8*)fd;
|
||||
|
||||
//hr = D3DERR_NOTAVAILABLE;
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,47 @@
|
|||
#include "d3d8Wrapper.h"
|
||||
|
||||
extern "C"
|
||||
{
|
||||
namespace D3D8Wrapper
|
||||
{
|
||||
D3D8Wrapper::IDirect3DBaseTexture8::IDirect3DBaseTexture8(D3D8Base::IDirect3DBaseTexture8* pTexture) : IDirect3DResource8((D3D8Base::IDirect3DResource8*) pTexture)
|
||||
{
|
||||
LOG("IDirect3DBaseTexture8 -- 1");
|
||||
m_pD3D = pTexture;
|
||||
}
|
||||
|
||||
D3D8Wrapper::IDirect3DBaseTexture8::IDirect3DBaseTexture8(D3D8Wrapper::IDirect3DBaseTexture8* pTexture) : IDirect3DResource8((D3D8Wrapper::IDirect3DResource8*) pTexture)
|
||||
{
|
||||
LOG("IDirect3DBaseTexture8 -- 2");
|
||||
m_pD3D = pTexture->getReal2();
|
||||
}
|
||||
|
||||
D3D8Base::IDirect3DBaseTexture8* D3D8Wrapper::IDirect3DBaseTexture8::getReal2()
|
||||
{
|
||||
LOG("IDirect3DBaseTexture8::getReal2");
|
||||
return m_pD3D;
|
||||
}
|
||||
|
||||
|
||||
/*STDMETHOD_(DWORD, SetLOD)(THIS_ DWORD LODNew) PURE;*/
|
||||
STDMETHODIMP_(DWORD) D3D8Wrapper::IDirect3DBaseTexture8::SetLOD(DWORD LODNew)
|
||||
{
|
||||
LOG("IDirect3DBaseTexture8::SetLOD");
|
||||
return m_pD3D->SetLOD(LODNew);
|
||||
}
|
||||
|
||||
/*STDMETHOD_(DWORD, GetLOD)(THIS) PURE;*/
|
||||
STDMETHODIMP_(DWORD) D3D8Wrapper::IDirect3DBaseTexture8::GetLOD()
|
||||
{
|
||||
LOG("IDirect3DBaseTexture8::GetLOD");
|
||||
return m_pD3D->GetLOD();
|
||||
}
|
||||
|
||||
/*STDMETHOD_(DWORD, GetLevelCount)(THIS) PURE;*/
|
||||
STDMETHODIMP_(DWORD) D3D8Wrapper::IDirect3DBaseTexture8::GetLevelCount()
|
||||
{
|
||||
LOG("IDirect3DBaseTexture8::GetLevelCount");
|
||||
return m_pD3D->GetLevelCount();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,65 @@
|
|||
#include "d3d8Wrapper.h"
|
||||
|
||||
extern "C"
|
||||
{
|
||||
namespace D3D8Wrapper
|
||||
{
|
||||
D3D8Wrapper::IDirect3DCubeTexture8::IDirect3DCubeTexture8(D3D8Base::IDirect3DCubeTexture8* pTexture) : IDirect3DBaseTexture8((D3D8Base::IDirect3DBaseTexture8*) pTexture)
|
||||
{
|
||||
LOG("IDirect3DCubeTexture8");
|
||||
m_pD3D = pTexture;
|
||||
}
|
||||
|
||||
/*STDMETHOD(GetLevelDesc)(THIS_ UINT Level,D3D8Base::D3DSURFACE_DESC *pDesc) PURE;*/
|
||||
STDMETHODIMP D3D8Wrapper::IDirect3DCubeTexture8::GetLevelDesc(UINT Level,D3D8Base::D3DSURFACE_DESC *pDesc)
|
||||
{
|
||||
LOG("IDirect3DCubeTexture8::GetLevelDesc");
|
||||
HRESULT hr = m_pD3D->GetLevelDesc(Level,pDesc);
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
/*STDMETHOD(GetCubeMapSurface)(THIS_ D3D8Base::D3DCUBEMAP_FACES FaceType,UINT Level,D3D8Wrapper::IDirect3DSurface8** ppCubeMapSurface) PURE;*/
|
||||
STDMETHODIMP D3D8Wrapper::IDirect3DCubeTexture8::GetCubeMapSurface(D3D8Base::D3DCUBEMAP_FACES FaceType,UINT Level,D3D8Wrapper::IDirect3DSurface8** ppCubeMapSurface)
|
||||
{
|
||||
LOG("IDirect3DCubeTexture8::GetCubeMapSurface");
|
||||
|
||||
D3D8Base::IDirect3DSurface8* fd = NULL;
|
||||
|
||||
HRESULT hr = m_pD3D->GetCubeMapSurface(FaceType,Level,&fd);//ppCubeMapSurface);
|
||||
|
||||
D3D8Wrapper::IDirect3DSurface8* f = D3D8Wrapper::IDirect3DSurface8::GetSurface(fd);
|
||||
|
||||
*ppCubeMapSurface = f;
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
/*STDMETHOD(LockRect)(THIS_ D3D8Base::D3DCUBEMAP_FACES FaceType,UINT Level,D3D8Base::D3DLOCKED_RECT* pLockedRect,CONST RECT* pRect,DWORD Flags) PURE;*/
|
||||
STDMETHODIMP D3D8Wrapper::IDirect3DCubeTexture8::LockRect(D3D8Base::D3DCUBEMAP_FACES FaceType,UINT Level,D3D8Base::D3DLOCKED_RECT* pLockedRect,CONST RECT* pRect,DWORD Flags)
|
||||
{
|
||||
LOG("IDirect3DCubeTexture8::LockRect");
|
||||
HRESULT hr = m_pD3D->LockRect(FaceType,Level,pLockedRect,pRect,Flags);
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
/*STDMETHOD(UnlockRect)(THIS_ D3D8Base::D3DCUBEMAP_FACES FaceType,UINT Level) PURE;*/
|
||||
STDMETHODIMP D3D8Wrapper::IDirect3DCubeTexture8::UnlockRect(D3D8Base::D3DCUBEMAP_FACES FaceType,UINT Level)
|
||||
{
|
||||
LOG("IDirect3DCubeTexture8::UnlockRect");
|
||||
HRESULT hr = m_pD3D->UnlockRect(FaceType,Level);
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
/*STDMETHOD(AddDirtyRect)(THIS_ D3D8Base::D3DCUBEMAP_FACES FaceType,CONST RECT* pDirtyRect) PURE;*/
|
||||
STDMETHODIMP D3D8Wrapper::IDirect3DCubeTexture8::AddDirtyRect(D3D8Base::D3DCUBEMAP_FACES FaceType,CONST RECT* pDirtyRect)
|
||||
{
|
||||
LOG("IDirect3DCubeTexture8::AddDirtyRect");
|
||||
HRESULT hr = m_pD3D->AddDirtyRect(FaceType,pDirtyRect);
|
||||
|
||||
return hr;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
#include "d3d8Wrapper.h"
|
||||
|
||||
extern "C"
|
||||
{
|
||||
namespace D3D8Wrapper
|
||||
{
|
||||
D3D8Wrapper::IDirect3DIndexBuffer8::IDirect3DIndexBuffer8(D3D8Base::IDirect3DIndexBuffer8* pTexture) : IDirect3DResource8((D3D8Base::IDirect3DResource8*) pTexture)
|
||||
{
|
||||
LOG("IDirect3DIndexBuffer8");
|
||||
m_pD3D = pTexture;
|
||||
}
|
||||
|
||||
D3D8Base::IDirect3DIndexBuffer8* D3D8Wrapper::IDirect3DIndexBuffer8::getReal2()
|
||||
{
|
||||
LOG("IDirect3DIndexBuffer8::getReal2");
|
||||
return m_pD3D;
|
||||
}
|
||||
|
||||
/*STDMETHOD(Lock)(THIS_ UINT OffsetToLock,UINT SizeToLock,BYTE** ppbData,DWORD Flags) PURE;*/
|
||||
STDMETHODIMP D3D8Wrapper::IDirect3DIndexBuffer8::Lock(UINT OffsetToLock,UINT SizeToLock,BYTE** ppbData,DWORD Flags)
|
||||
{
|
||||
LOG("IDirect3DIndexBuffer8::Lock");
|
||||
HRESULT hr = m_pD3D->Lock(OffsetToLock,SizeToLock,ppbData,Flags);
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
/*STDMETHOD(Unlock)(THIS) PURE;*/
|
||||
STDMETHODIMP D3D8Wrapper::IDirect3DIndexBuffer8::Unlock()
|
||||
{
|
||||
LOG("IDirect3DIndexBuffer8::Unlock");
|
||||
HRESULT hr = m_pD3D->Unlock();
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
/*STDMETHOD(GetDesc)(THIS_ D3D8Base::D3DINDEXBUFFER_DESC *pDesc) PURE;*/
|
||||
STDMETHODIMP D3D8Wrapper::IDirect3DIndexBuffer8::GetDesc(D3D8Base::D3DINDEXBUFFER_DESC *pDesc)
|
||||
{
|
||||
LOG("IDirect3DIndexBuffer8::GetDesc");
|
||||
HRESULT hr = m_pD3D->GetDesc(pDesc);
|
||||
|
||||
return hr;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,123 @@
|
|||
#include "d3d8Wrapper.h"
|
||||
|
||||
extern "C"
|
||||
{
|
||||
namespace D3D8Wrapper
|
||||
{
|
||||
D3D8Wrapper::IDirect3DResource8::IDirect3DResource8(D3D8Base::IDirect3DResource8* pResource) : IDirect3DUnknown((IUnknown*) pResource)
|
||||
{
|
||||
LOG("IDirect3DResource8");
|
||||
m_pD3D = pResource;
|
||||
}
|
||||
|
||||
D3D8Wrapper::IDirect3DResource8::IDirect3DResource8(D3D8Wrapper::IDirect3DResource8* pResource) : IDirect3DUnknown((IUnknown*) pResource)
|
||||
{
|
||||
LOG("IDirect3DResource8 -- 2");
|
||||
m_pD3D = pResource->getReal();
|
||||
}
|
||||
|
||||
D3D8Wrapper::IDirect3DResource8* D3D8Wrapper::IDirect3DResource8::GetResource(D3D8Base::IDirect3DResource8* pSwapChain)
|
||||
{
|
||||
D3D8Wrapper::IDirect3DResource8* p = (D3D8Wrapper::IDirect3DResource8*) m_List.GetDataPtr(pSwapChain);
|
||||
if( p == NULL )
|
||||
{
|
||||
p = new D3D8Wrapper::IDirect3DResource8(pSwapChain);
|
||||
m_List.AddMember(pSwapChain, p);
|
||||
return p;
|
||||
}
|
||||
|
||||
p->m_ulRef++;
|
||||
return p;
|
||||
}
|
||||
|
||||
STDMETHODIMP_(ULONG) D3D8Wrapper::IDirect3DResource8::Release(THIS)
|
||||
{
|
||||
m_pUnk->Release();
|
||||
|
||||
ULONG ulRef = --m_ulRef;
|
||||
if(ulRef == 0)
|
||||
{
|
||||
m_List.DeleteMember(GetResource());
|
||||
delete this;
|
||||
return 0;
|
||||
}
|
||||
return ulRef;
|
||||
}
|
||||
|
||||
D3D8Base::IDirect3DResource8* D3D8Wrapper::IDirect3DResource8::getReal()
|
||||
{
|
||||
LOG("IDirect3DResource8::getReal");
|
||||
return m_pD3D;
|
||||
}
|
||||
|
||||
/*STDMETHOD(GetDevice)(THIS_ IDirect3DDevice8** ppDevice) PURE;*/
|
||||
STDMETHODIMP D3D8Wrapper::IDirect3DResource8::GetDevice(D3D8Wrapper::IDirect3DDevice8** ppDevice)
|
||||
{
|
||||
LOG("IDirect3DResource8::GetDevice");
|
||||
D3D8Base::IDirect3DDevice8* fd = NULL;
|
||||
|
||||
HRESULT hr = m_pD3D->GetDevice(&fd);//ppDevice);
|
||||
|
||||
D3D8Wrapper::IDirect3DDevice8* f = new D3D8Wrapper::IDirect3DDevice8(fd);
|
||||
|
||||
*ppDevice = f;
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
/*STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) PURE;*/
|
||||
STDMETHODIMP D3D8Wrapper::IDirect3DResource8::SetPrivateData(REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags)
|
||||
{
|
||||
LOG("IDirect3DResource8::SetPrivateData");
|
||||
HRESULT hr = m_pD3D->SetPrivateData(refguid,pData,SizeOfData,Flags);
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
/*STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData) PURE;*/
|
||||
STDMETHODIMP D3D8Wrapper::IDirect3DResource8::GetPrivateData(REFGUID refguid,void* pData,DWORD* pSizeOfData)
|
||||
{
|
||||
LOG("IDirect3DResource8::GetPrivateData");
|
||||
HRESULT hr = m_pD3D->GetPrivateData(refguid,pData,pSizeOfData);
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
/*STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE;*/
|
||||
STDMETHODIMP D3D8Wrapper::IDirect3DResource8::FreePrivateData(REFGUID refguid)
|
||||
{
|
||||
LOG("IDirect3DResource8::FreePrivateData");
|
||||
HRESULT hr = m_pD3D->FreePrivateData(refguid);
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
/*STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE;*/
|
||||
STDMETHODIMP_(DWORD) D3D8Wrapper::IDirect3DResource8::SetPriority(DWORD PriorityNew)
|
||||
{
|
||||
LOG("IDirect3DResource8::SetPriority");
|
||||
return m_pD3D->SetPriority(PriorityNew);
|
||||
}
|
||||
|
||||
/*STDMETHOD_(DWORD, GetPriority)(THIS) PURE;*/
|
||||
STDMETHODIMP_(DWORD) D3D8Wrapper::IDirect3DResource8::GetPriority()
|
||||
{
|
||||
LOG("IDirect3DResource8::GetPriority");
|
||||
return m_pD3D->GetPriority();
|
||||
}
|
||||
|
||||
/*STDMETHOD_(void, PreLoad)(THIS) PURE;*/
|
||||
STDMETHODIMP_(void) D3D8Wrapper::IDirect3DResource8::PreLoad()
|
||||
{
|
||||
LOG("IDirect3DResource8::PreLoad");
|
||||
return m_pD3D->PreLoad();
|
||||
}
|
||||
|
||||
/*STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS) PURE;*/
|
||||
STDMETHODIMP_(D3D8Base::D3DRESOURCETYPE) D3D8Wrapper::IDirect3DResource8::GetType()
|
||||
{
|
||||
LOG("IDirect3DResource8::GetType");
|
||||
return m_pD3D->GetType();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,125 @@
|
|||
#include "d3d8Wrapper.h"
|
||||
|
||||
extern "C"
|
||||
{
|
||||
namespace D3D8Wrapper
|
||||
{
|
||||
D3D8Wrapper::IDirect3DSurface8::IDirect3DSurface8(D3D8Base::IDirect3DSurface8* pTexture) : IDirect3DUnknown((IUnknown*) pTexture)
|
||||
{
|
||||
LOG("IDirect3DSurface8");
|
||||
LOG(this);
|
||||
m_pD3D = pTexture;
|
||||
}
|
||||
|
||||
D3D8Wrapper::IDirect3DSurface8* D3D8Wrapper::IDirect3DSurface8::GetSurface(D3D8Base::IDirect3DSurface8* pSurface)
|
||||
{
|
||||
LOG("GetSurface");
|
||||
LOG(pSurface);
|
||||
D3D8Wrapper::IDirect3DSurface8* p = (D3D8Wrapper::IDirect3DSurface8*) m_List.GetDataPtr(pSurface);
|
||||
if(p == NULL)
|
||||
{
|
||||
p = new IDirect3DSurface8(pSurface);
|
||||
m_List.AddMember(pSurface, p);
|
||||
return p;
|
||||
}
|
||||
|
||||
p->m_ulRef++;
|
||||
return p;
|
||||
}
|
||||
|
||||
STDMETHODIMP_(ULONG) D3D8Wrapper::IDirect3DSurface8::Release(THIS)
|
||||
{
|
||||
LOG("IDirect3DSurface8::Release");
|
||||
LOG(this);
|
||||
m_pUnk->Release();
|
||||
|
||||
ULONG ulRef = --m_ulRef;
|
||||
if(ulRef == 0)
|
||||
{
|
||||
m_List.DeleteMember(GetSurface8());
|
||||
delete this;
|
||||
return 0;
|
||||
}
|
||||
return ulRef;
|
||||
}
|
||||
|
||||
/*STDMETHOD(GetDevice)(THIS_ D3D8Wrapper::IDirect3DDevice8** ppDevice) PURE;*/
|
||||
STDMETHODIMP D3D8Wrapper::IDirect3DSurface8::GetDevice(D3D8Wrapper::IDirect3DDevice8** ppDevice)
|
||||
{
|
||||
LOG("IDirect3DSurface8::GetDevice");
|
||||
|
||||
D3D8Base::IDirect3DDevice8* fd = NULL;
|
||||
|
||||
HRESULT hr = m_pD3D->GetDevice(&fd);//ppDevice);
|
||||
|
||||
D3D8Wrapper::IDirect3DDevice8* f = new D3D8Wrapper::IDirect3DDevice8(fd);
|
||||
|
||||
*ppDevice = f;
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
/*STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) PURE;*/
|
||||
STDMETHODIMP D3D8Wrapper::IDirect3DSurface8::SetPrivateData(REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags)
|
||||
{
|
||||
LOG("IDirect3DSurface8::SetPrivateData");
|
||||
HRESULT hr = m_pD3D->SetPrivateData(refguid,pData,SizeOfData,Flags);
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
/*STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData) PURE;*/
|
||||
STDMETHODIMP D3D8Wrapper::IDirect3DSurface8::GetPrivateData(REFGUID refguid,void* pData,DWORD* pSizeOfData)
|
||||
{
|
||||
LOG("IDirect3DSurface8::GetPrivateData");
|
||||
HRESULT hr = m_pD3D->GetPrivateData(refguid,pData,pSizeOfData);
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
/*STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE;*/
|
||||
STDMETHODIMP D3D8Wrapper::IDirect3DSurface8::FreePrivateData(REFGUID refguid)
|
||||
{
|
||||
LOG("IDirect3DSurface8::FreePrivateData");
|
||||
HRESULT hr = m_pD3D->FreePrivateData(refguid);
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
/*STDMETHOD(GetContainer)(THIS_ REFIID riid,void** ppContainer) PURE;*/
|
||||
STDMETHODIMP D3D8Wrapper::IDirect3DSurface8::GetContainer(REFIID riid,void** ppContainer)
|
||||
{
|
||||
LOG("IDirect3DSurface8::GetContainer");
|
||||
HRESULT hr = m_pD3D->GetContainer(riid,ppContainer);
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
/*STDMETHOD(GetDesc)(THIS_ D3D8Base::D3DSURFACE_DESC *pDesc) PURE;*/
|
||||
STDMETHODIMP D3D8Wrapper::IDirect3DSurface8::GetDesc(D3D8Base::D3DSURFACE_DESC *pDesc)
|
||||
{
|
||||
LOG("IDirect3DSurface8::GetDesc");
|
||||
HRESULT hr = m_pD3D->GetDesc(pDesc);
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
/*STDMETHOD(LockRect)(THIS_ D3D8Base::D3DLOCKED_RECT* pLockedRect,CONST RECT* pRect,DWORD Flags) PURE;*/
|
||||
STDMETHODIMP D3D8Wrapper::IDirect3DSurface8::LockRect(D3D8Base::D3DLOCKED_RECT* pLockedRect,CONST RECT* pRect,DWORD Flags)
|
||||
{
|
||||
LOG("IDirect3DSurface8::LockRect");
|
||||
HRESULT hr = m_pD3D->LockRect(pLockedRect,pRect,Flags);
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
/*STDMETHOD(UnlockRect)(THIS) PURE;*/
|
||||
STDMETHODIMP D3D8Wrapper::IDirect3DSurface8::UnlockRect()
|
||||
{
|
||||
LOG("IDirect3DSurface8::UnlockRect");
|
||||
HRESULT hr = m_pD3D->UnlockRect();
|
||||
|
||||
return hr;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,64 @@
|
|||
#include "d3d8Wrapper.h"
|
||||
|
||||
extern "C"
|
||||
{
|
||||
namespace D3D8Wrapper
|
||||
{
|
||||
D3D8Wrapper::IDirect3DSwapChain8::IDirect3DSwapChain8(D3D8Base::IDirect3DSwapChain8* pSwapChain) : IDirect3DUnknown((IUnknown*) pSwapChain)
|
||||
{
|
||||
LOG("IDirect3DSwapChain8");
|
||||
m_pD3D = pSwapChain;
|
||||
}
|
||||
|
||||
D3D8Wrapper::IDirect3DSwapChain8* D3D8Wrapper::IDirect3DSwapChain8::GetSwapChain(D3D8Base::IDirect3DSwapChain8* pSwapChain)
|
||||
{
|
||||
D3D8Wrapper::IDirect3DSwapChain8* p = (D3D8Wrapper::IDirect3DSwapChain8*) m_List.GetDataPtr(pSwapChain);
|
||||
if( p == NULL )
|
||||
{
|
||||
p = new D3D8Wrapper::IDirect3DSwapChain8(pSwapChain);
|
||||
m_List.AddMember(pSwapChain, p);
|
||||
return p;
|
||||
}
|
||||
|
||||
p->m_ulRef++;
|
||||
return p;
|
||||
}
|
||||
|
||||
STDMETHODIMP_(ULONG) D3D8Wrapper::IDirect3DSwapChain8::Release(THIS)
|
||||
{
|
||||
m_pUnk->Release();
|
||||
|
||||
ULONG ulRef = --m_ulRef;
|
||||
if(ulRef == 0)
|
||||
{
|
||||
m_List.DeleteMember(GetSwapChain8());
|
||||
delete this;
|
||||
return 0;
|
||||
}
|
||||
return ulRef;
|
||||
}
|
||||
|
||||
STDMETHODIMP D3D8Wrapper::IDirect3DSwapChain8::Present(CONST RECT* pSourceRect,CONST RECT* pDestRect,HWND hDestWindowOverride,CONST RGNDATA* pDirtyRegion)
|
||||
{
|
||||
LOG("IDirect3DSwapChain8::Present");
|
||||
HRESULT hr = m_pD3D->Present(pSourceRect,pDestRect,hDestWindowOverride,pDirtyRegion);
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
STDMETHODIMP D3D8Wrapper::IDirect3DSwapChain8::GetBackBuffer(UINT BackBuffer,D3D8Base::D3DBACKBUFFER_TYPE Type,D3D8Wrapper::IDirect3DSurface8** ppBackBuffer)
|
||||
{
|
||||
LOG("IDirect3DSwapChain8::GetBackBuffer");
|
||||
|
||||
D3D8Base::IDirect3DSurface8* fd = NULL;
|
||||
|
||||
HRESULT hr = m_pD3D->GetBackBuffer(BackBuffer,Type,&fd);//ppBackBuffer);
|
||||
|
||||
D3D8Wrapper::IDirect3DSurface8* f = D3D8Wrapper::IDirect3DSurface8::GetSurface(fd);
|
||||
|
||||
*ppBackBuffer = f;
|
||||
|
||||
return hr;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,70 @@
|
|||
#include "d3d8Wrapper.h"
|
||||
|
||||
extern "C"
|
||||
{
|
||||
namespace D3D8Wrapper
|
||||
{
|
||||
D3D8Wrapper::IDirect3DTexture8::IDirect3DTexture8(D3D8Base::IDirect3DTexture8* pTexture) : IDirect3DBaseTexture8((D3D8Base::IDirect3DBaseTexture8*) pTexture)
|
||||
{
|
||||
LOG("IDirect3DBaseTexture8");
|
||||
m_pD3D = pTexture;
|
||||
}
|
||||
|
||||
|
||||
/*STDMETHOD(GetLevelDesc)(THIS_ UINT Level,D3D8Base::D3DSURFACE_DESC *pDesc) PURE;*/
|
||||
STDMETHODIMP D3D8Wrapper::IDirect3DTexture8::GetLevelDesc(UINT Level,D3D8Base::D3DSURFACE_DESC *pDesc)
|
||||
{
|
||||
LOG("IDirect3DTexture8::GetLevelDesc");
|
||||
HRESULT hr = m_pD3D->GetLevelDesc(Level,pDesc);
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
/*STDMETHOD(GetSurfaceLevel)(THIS_ UINT Level,D3D8Wrapper::IDirect3DSurface8** ppSurfaceLevel) PURE;*/
|
||||
STDMETHODIMP D3D8Wrapper::IDirect3DTexture8::GetSurfaceLevel(UINT Level,D3D8Wrapper::IDirect3DSurface8** ppSurfaceLevel)
|
||||
{
|
||||
LOG("IDirect3DTexture8::GetSurfaceLevel");
|
||||
|
||||
D3D8Base::IDirect3DSurface8* fd = NULL;
|
||||
|
||||
HRESULT hr = m_pD3D->GetSurfaceLevel(Level,&fd);//ppSurfaceLevel);
|
||||
|
||||
D3D8Wrapper::IDirect3DSurface8* f = D3D8Wrapper::IDirect3DSurface8::GetSurface(fd);
|
||||
|
||||
*ppSurfaceLevel = f;
|
||||
|
||||
LOG(f);
|
||||
LOG(f->GetSurface8());
|
||||
LOG(hr);
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
/*STDMETHOD(LockRect)(THIS_ UINT Level,D3D8Base::D3DLOCKED_RECT* pLockedRect,CONST RECT* pRect,DWORD Flags) PURE;*/
|
||||
STDMETHODIMP D3D8Wrapper::IDirect3DTexture8::LockRect(UINT Level,D3D8Base::D3DLOCKED_RECT* pLockedRect,CONST RECT* pRect,DWORD Flags)
|
||||
{
|
||||
LOG("IDirect3DTexture8::LockRect");
|
||||
HRESULT hr = m_pD3D->LockRect(Level,pLockedRect,pRect,Flags);
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
/*STDMETHOD(UnlockRect)(THIS_ UINT Level) PURE;*/
|
||||
STDMETHODIMP D3D8Wrapper::IDirect3DTexture8::UnlockRect(UINT Level)
|
||||
{
|
||||
LOG("IDirect3DTexture8::UnlockRect");
|
||||
HRESULT hr = m_pD3D->UnlockRect(Level);
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
/*STDMETHOD(AddDirtyRect)(THIS_ CONST RECT* pDirtyRect) PURE;*/
|
||||
STDMETHODIMP D3D8Wrapper::IDirect3DTexture8::AddDirtyRect(CONST RECT* pDirtyRect)
|
||||
{
|
||||
LOG("IDirect3DTexture8::AddDirtyRect");
|
||||
HRESULT hr = m_pD3D->AddDirtyRect(pDirtyRect);
|
||||
|
||||
return hr;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
#include "d3d8Wrapper.h"
|
||||
|
||||
extern "C"
|
||||
{
|
||||
namespace D3D8Wrapper
|
||||
{
|
||||
D3D8Wrapper::IDirect3DVertexBuffer8::IDirect3DVertexBuffer8(D3D8Base::IDirect3DVertexBuffer8* pTexture) : IDirect3DResource8((D3D8Base::IDirect3DResource8*) pTexture)
|
||||
{
|
||||
LOG("IDirect3DVertexBuffer8");
|
||||
m_pD3D = pTexture;
|
||||
}
|
||||
|
||||
D3D8Base::IDirect3DVertexBuffer8* D3D8Wrapper::IDirect3DVertexBuffer8::getReal2()
|
||||
{
|
||||
LOG("IDirect3DVertexBuffer8::getReal2");
|
||||
return m_pD3D;
|
||||
}
|
||||
|
||||
/*STDMETHOD(Lock)(THIS_ UINT OffsetToLock,UINT SizeToLock,BYTE** ppbData,DWORD Flags) PURE;*/
|
||||
STDMETHODIMP D3D8Wrapper::IDirect3DVertexBuffer8::Lock(UINT OffsetToLock,UINT SizeToLock,BYTE** ppbData,DWORD Flags)
|
||||
{
|
||||
LOG("IDirect3DVertexBuffer8::Lock");
|
||||
HRESULT hr = m_pD3D->Lock(OffsetToLock,SizeToLock,ppbData,Flags);
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
/*STDMETHOD(Unlock)(THIS) PURE;*/
|
||||
STDMETHODIMP D3D8Wrapper::IDirect3DVertexBuffer8::Unlock()
|
||||
{
|
||||
LOG("IDirect3DVertexBuffer8::Unlock");
|
||||
HRESULT hr = m_pD3D->Unlock();
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
/*STDMETHOD(GetDesc)(THIS_ D3D8Base::D3DVERTEXBUFFER_DESC *pDesc) PURE;*/
|
||||
STDMETHODIMP D3D8Wrapper::IDirect3DVertexBuffer8::GetDesc(D3D8Base::D3DVERTEXBUFFER_DESC *pDesc)
|
||||
{
|
||||
LOG("IDirect3DVertexBuffer8::GetDesc");
|
||||
HRESULT hr = m_pD3D->GetDesc(pDesc);
|
||||
|
||||
return hr;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,92 @@
|
|||
#include "d3d8Wrapper.h"
|
||||
|
||||
extern "C"
|
||||
{
|
||||
namespace D3D8Wrapper
|
||||
{
|
||||
D3D8Wrapper::IDirect3DVolume8::IDirect3DVolume8(D3D8Base::IDirect3DVolume8* pTexture) : IDirect3DUnknown((IUnknown*) pTexture)
|
||||
{
|
||||
LOG("IDirect3DVolume8");
|
||||
m_pD3D = pTexture;
|
||||
}
|
||||
|
||||
/*STDMETHOD(GetDevice)(THIS_ D3D8Wrapper::IDirect3DDevice8** ppDevice) PURE;*/
|
||||
STDMETHODIMP D3D8Wrapper::IDirect3DVolume8::GetDevice(D3D8Wrapper::IDirect3DDevice8** ppDevice)
|
||||
{
|
||||
LOG("IDirect3DVolume8::GetDevice");
|
||||
|
||||
D3D8Base::IDirect3DDevice8* fd = NULL;
|
||||
|
||||
HRESULT hr = m_pD3D->GetDevice(&fd);//ppDevice);
|
||||
|
||||
D3D8Wrapper::IDirect3DDevice8* f = new D3D8Wrapper::IDirect3DDevice8(fd);
|
||||
|
||||
*ppDevice = f;
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
/*STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) PURE;*/
|
||||
STDMETHODIMP D3D8Wrapper::IDirect3DVolume8::SetPrivateData(REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags)
|
||||
{
|
||||
LOG("IDirect3DVolume8::SetPrivateData");
|
||||
HRESULT hr = m_pD3D->SetPrivateData(refguid,pData,SizeOfData,Flags);
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
/*STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData) PURE;*/
|
||||
STDMETHODIMP D3D8Wrapper::IDirect3DVolume8::GetPrivateData(REFGUID refguid,void* pData,DWORD* pSizeOfData)
|
||||
{
|
||||
LOG("IDirect3DVolume8::GetPrivateData");
|
||||
HRESULT hr = m_pD3D->GetPrivateData(refguid,pData,pSizeOfData);
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
/*STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE;*/
|
||||
STDMETHODIMP D3D8Wrapper::IDirect3DVolume8::FreePrivateData(REFGUID refguid)
|
||||
{
|
||||
LOG("IDirect3DVolume8::FreePrivateData");
|
||||
HRESULT hr = m_pD3D->FreePrivateData(refguid);
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
/*STDMETHOD(GetContainer)(THIS_ REFIID riid,void** ppContainer) PURE;*/
|
||||
STDMETHODIMP D3D8Wrapper::IDirect3DVolume8::GetContainer(REFIID riid,void** ppContainer)
|
||||
{
|
||||
LOG("IDirect3DVolume8::GetContainer");
|
||||
HRESULT hr = m_pD3D->GetContainer(riid,ppContainer);
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
/*STDMETHOD(GetDesc)(THIS_ D3D8Base::D3DVOLUME_DESC *pDesc) PURE;*/
|
||||
STDMETHODIMP D3D8Wrapper::IDirect3DVolume8::GetDesc(D3D8Base::D3DVOLUME_DESC *pDesc)
|
||||
{
|
||||
LOG("IDirect3DVolume8::GetDesc");
|
||||
HRESULT hr = m_pD3D->GetDesc(pDesc);
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
/*STDMETHOD(LockBox)(THIS_ D3D8Base::D3DLOCKED_BOX * pLockedVolume,CONST D3D8Base::D3DBOX* pBox,DWORD Flags) PURE;*/
|
||||
STDMETHODIMP D3D8Wrapper::IDirect3DVolume8::LockBox(D3D8Base::D3DLOCKED_BOX * pLockedVolume,CONST D3D8Base::D3DBOX* pBox,DWORD Flags)
|
||||
{
|
||||
LOG("IDirect3DVolume8::LockBox");
|
||||
HRESULT hr = m_pD3D->LockBox(pLockedVolume,pBox,Flags);
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
/*STDMETHOD(UnlockBox)(THIS) PURE;*/
|
||||
STDMETHODIMP D3D8Wrapper::IDirect3DVolume8::UnlockBox()
|
||||
{
|
||||
LOG("IDirect3DVolume8::UnlockBox");
|
||||
HRESULT hr = m_pD3D->UnlockBox();
|
||||
|
||||
return hr;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,65 @@
|
|||
#include "d3d8Wrapper.h"
|
||||
|
||||
extern "C"
|
||||
{
|
||||
namespace D3D8Wrapper
|
||||
{
|
||||
D3D8Wrapper::IDirect3DVolumeTexture8::IDirect3DVolumeTexture8(D3D8Base::IDirect3DVolumeTexture8* pTexture) : IDirect3DBaseTexture8((D3D8Base::IDirect3DBaseTexture8*) pTexture)
|
||||
{
|
||||
LOG("IDirect3DBaseTexture8");
|
||||
m_pD3D = pTexture;
|
||||
}
|
||||
|
||||
/*STDMETHOD(GetLevelDesc)(THIS_ UINT Level,D3D8Base::D3DVOLUME_DESC *pDesc) PURE;*/
|
||||
STDMETHODIMP D3D8Wrapper::IDirect3DVolumeTexture8::GetLevelDesc(UINT Level,D3D8Base::D3DVOLUME_DESC *pDesc)
|
||||
{
|
||||
LOG("IDirect3DVolumeTexture8::GetLevelDesc");
|
||||
HRESULT hr = m_pD3D->GetLevelDesc(Level,pDesc);
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
/*STDMETHOD(GetVolumeLevel)(THIS_ UINT Level,IDirect3DVolume8** ppVolumeLevel) PURE;*/
|
||||
STDMETHODIMP D3D8Wrapper::IDirect3DVolumeTexture8::GetVolumeLevel(UINT Level,D3D8Wrapper::IDirect3DVolume8** ppVolumeLevel)
|
||||
{
|
||||
LOG("IDirect3DVolumeTexture8::GetVolumeLevel");
|
||||
|
||||
D3D8Base::IDirect3DVolume8* fd = NULL;
|
||||
|
||||
HRESULT hr = m_pD3D->GetVolumeLevel(Level,&fd);//ppVolumeLevel);
|
||||
|
||||
D3D8Wrapper::IDirect3DVolume8* f = new D3D8Wrapper::IDirect3DVolume8(fd);
|
||||
|
||||
*ppVolumeLevel = f;
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
/*STDMETHOD(LockBox)(THIS_ UINT Level,D3D8Base::D3DLOCKED_BOX* pLockedVolume,CONST D3D8Base::D3DBOX* pBox,DWORD Flags) PURE;*/
|
||||
STDMETHODIMP D3D8Wrapper::IDirect3DVolumeTexture8::LockBox(UINT Level,D3D8Base::D3DLOCKED_BOX* pLockedVolume,CONST D3D8Base::D3DBOX* pBox,DWORD Flags)
|
||||
{
|
||||
LOG("IDirect3DVolumeTexture8::LockBox");
|
||||
HRESULT hr = m_pD3D->LockBox(Level,pLockedVolume,pBox,Flags);
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
/*STDMETHOD(UnlockBox)(THIS_ UINT Level) PURE;*/
|
||||
STDMETHODIMP D3D8Wrapper::IDirect3DVolumeTexture8::UnlockBox(UINT Level)
|
||||
{
|
||||
LOG("IDirect3DVolumeTexture8::UnlockBox");
|
||||
HRESULT hr = m_pD3D->UnlockBox(Level);
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
/*STDMETHOD(AddDirtyBox)(THIS_ CONST D3D8Base::D3DBOX* pDirtyBox) PURE;*/
|
||||
STDMETHODIMP D3D8Wrapper::IDirect3DVolumeTexture8::AddDirtyBox(CONST D3D8Base::D3DBOX* pDirtyBox)
|
||||
{
|
||||
LOG("IDirect3DVolumeTexture8::AddDirtyBox");
|
||||
HRESULT hr = m_pD3D->AddDirtyBox(pDirtyBox);
|
||||
|
||||
return hr;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,5 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <objidl.h>
|
||||
|
||||
const UINT PointerSetHashSize = 128;
|
||||
|
||||
struct PointerLinkedList
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,10 +1,14 @@
|
|||
//#include <windows.h>
|
||||
#include <objidl.h>
|
||||
//#include <gdiplus.h>
|
||||
//using namespace Gdiplus;
|
||||
//#pragma comment (lib,"Gdiplus.lib")
|
||||
#pragma once
|
||||
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include "PointerSet.h"
|
||||
|
||||
#pragma comment(linker, "/EXPORT:Direct3DCreate8=_Direct3DCreate8@4")
|
||||
|
||||
//#define LOG(x) { std::ofstream myfile; myfile.open ("d3d8_wrapper_log.txt", std::ios::app); myfile << x << "\n"; myfile.close(); }
|
||||
#define LOG(x)
|
||||
|
||||
#define TESTDLL_API __declspec(dllexport)
|
||||
|
||||
namespace D3D8Base
|
||||
|
@ -511,6 +515,8 @@ extern "C"
|
|||
|
||||
|
||||
typedef D3D8Base::IDirect3D8* (WINAPI *D3DCREATE)(UINT);
|
||||
D3D8Wrapper::IDirect3D8* WINAPI Direct3DCreate8(UINT Version);
|
||||
IDirect3D8* WINAPI Direct3DCreate8(UINT Version);
|
||||
extern IDirect3DDevice8 *last_device;
|
||||
extern void (*rendering_callback)( int );
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue