Skip to content

Commit

Permalink
Merge pull request OpenXRay#22 from SpaceBrain/pvsfixes
Browse files Browse the repository at this point in the history
Various fixes in xrD3D9-Null
  • Loading branch information
Pavel Kovalenko committed Apr 23, 2015
2 parents c4a7c11 + ec1c19a commit 5defbb4
Show file tree
Hide file tree
Showing 20 changed files with 283 additions and 417 deletions.
55 changes: 19 additions & 36 deletions src/xrD3D9-Null/IDirect3D9.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@
#include "IDirect3D9.h"
#include "IDirect3DDevice9.h"
#include "xrD3D9-Null_OutProc.h"
#include <stdio.h>

#include <stdlib.h>
#include <objbase.h>
#include <windows.h>
#include "stdio.h"

const GUID DECLSPEC_SELECTANY IID_IDirect3D9;

Expand All @@ -22,7 +19,7 @@ ULONG xrIDirect3D9::AddRef(void)
{
APIDEBUG("xrIDirect3D9::AddRef");
m_refCount++;
return ULONG_Proc(m_refCount);
return m_refCount;
}

ULONG xrIDirect3D9::Release(void)
Expand All @@ -32,9 +29,9 @@ ULONG xrIDirect3D9::Release(void)
if (m_refCount < 0)
{
delete this;
return ULONG_Proc(-1);
return -1;
}
return ULONG_Proc(m_refCount);
return m_refCount;
}

HRESULT xrIDirect3D9::QueryInterface(const IID &iid, void FAR* FAR* ppvObj)
Expand All @@ -44,20 +41,20 @@ HRESULT xrIDirect3D9::QueryInterface(const IID &iid, void FAR* FAR* ppvObj)
{
*ppvObj = this;
AddRef();
return HRESULT_Proc(NOERROR);
return NOERROR;
}
return HRESULT_Proc(E_NOINTERFACE);
return E_NOINTERFACE;
}

HRESULT xrIDirect3D9::RegisterSoftwareDevice(void* pInitializeFunction)
{
APIDEBUG("xrIDirect3D9::RegisterSoftwareDevice");
return HRESULT_Proc(S_OK);
return S_OK;
};
UINT xrIDirect3D9::GetAdapterCount()
{
APIDEBUG("xrIDirect3D9::GetAdapterCount");
return ULONG_Proc(1);
return 1;
};

HRESULT xrIDirect3D9::GetAdapterIdentifier(UINT Adapter,DWORD Flags,D3DADAPTER_IDENTIFIER9* pIdentifier)
Expand All @@ -66,56 +63,56 @@ HRESULT xrIDirect3D9::GetAdapterIdentifier(UINT Adapter,DWORD Flags,D3DADAPTER_I
sprintf_s(pIdentifier->Driver, "Default Driver");
sprintf_s(pIdentifier->Description, "Default X-Ray Dedicated Adapter");
sprintf_s(pIdentifier->DeviceName, "Dedicated");
return HRESULT_Proc(S_OK);
return S_OK;
};
UINT xrIDirect3D9::GetAdapterModeCount( UINT Adapter,D3DFORMAT Format)
{
APIDEBUG("xrIDirect3D9::GetAdapterModeCount");
return ULONG_Proc(1);
return 1;
};

HRESULT xrIDirect3D9::EnumAdapterModes(UINT Adapter,D3DFORMAT Format,UINT Mode,D3DDISPLAYMODE* pMode)
{
APIDEBUG("xrIDirect3D9::EnumAdapterModes");
return HRESULT_Proc(S_OK);
return S_OK;
};
HRESULT xrIDirect3D9::GetAdapterDisplayMode( UINT Adapter,D3DDISPLAYMODE* pMode)
{
APIDEBUG("xrIDirect3D9::GetAdapterDisplayMode");
pMode->Format = D3DFMT_A8R8G8B8;
return HRESULT_Proc(S_OK);
return S_OK;
};
HRESULT xrIDirect3D9::CheckDeviceType( UINT Adapter,D3DDEVTYPE DevType,D3DFORMAT AdapterFormat,D3DFORMAT BackBufferFormat,BOOL bWindowed)
{
APIDEBUG("xrIDirect3D9::CheckDeviceType");
return HRESULT_Proc(S_OK);
return S_OK;
};
HRESULT xrIDirect3D9::CheckDeviceFormat( UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT AdapterFormat,DWORD Usage,D3DRESOURCETYPE RType,D3DFORMAT CheckFormat)
{
APIDEBUG("xrIDirect3D9::CheckDeviceFormat");
return HRESULT_Proc(S_OK);
return S_OK;
};
HRESULT xrIDirect3D9::CheckDeviceMultiSampleType( UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT SurfaceFormat,BOOL Windowed,D3DMULTISAMPLE_TYPE MultiSampleType,DWORD* pQualityLevels)
{
APIDEBUG("xrIDirect3D9::CheckDeviceMultiSampleType");
return HRESULT_Proc(S_OK);
return S_OK;
};
HRESULT xrIDirect3D9::CheckDepthStencilMatch( UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT AdapterFormat,D3DFORMAT RenderTargetFormat,D3DFORMAT DepthStencilFormat)
{
APIDEBUG("xrIDirect3D9::CheckDepthStencilMatch");
return HRESULT_Proc(S_OK);
return S_OK;
};
HRESULT xrIDirect3D9::CheckDeviceFormatConversion( UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT SourceFormat,D3DFORMAT TargetFormat)
{
APIDEBUG("xrIDirect3D9::CheckDeviceFormatConversion");
return HRESULT_Proc(S_OK);
return S_OK;
};
HRESULT xrIDirect3D9::GetDeviceCaps( UINT Adapter,D3DDEVTYPE DeviceType,D3DCAPS9* pCaps)
{
APIDEBUG("xrIDirect3D9::GetDeviceCaps");
if (pCaps)
ZeroMemory(pCaps,sizeof(D3DCAPS9));
return HRESULT_Proc(S_OK);
return S_OK;
};
HMONITOR xrIDirect3D9::GetAdapterMonitor( UINT Adapter)
{
Expand All @@ -129,19 +126,5 @@ HRESULT xrIDirect3D9::CreateDevice (UINT Adapter,D3DDEVTYPE DeviceType,HWND hFoc
*ppReturnedDeviceInterface = NULL;
xrIDirect3DDevice9* I = new xrIDirect3DDevice9(this, pPresentationParameters);
*ppReturnedDeviceInterface = I;
return HRESULT_Proc(S_OK);
return S_OK;
};
//-------------------------------------------------------------------
/*
HRESULT xrIDirect3D9::HRESULT_Proc(HRESULT ret)
{
return ret;
}
ULONG xrIDirect3D9::ULONG_Proc(ULONG ret)
{
return ret;
}
*/


7 changes: 1 addition & 6 deletions src/xrD3D9-Null/IDirect3D9.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
//---------------------------------
#include <stdlib.h>
#include <objbase.h>
#include <windows.h>

#include "d3d9.h"
#include "stdafx.h"

/*
//---------------------------------
Expand Down
46 changes: 23 additions & 23 deletions src/xrD3D9-Null/IDirect3DCubeTexture9.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@ HRESULT xrIDirect3DCubeTexture9::QueryInterface( REFIID riid, void** ppvObj)
{
*ppvObj = this;
AddRef();
return HRESULT_Proc(NOERROR);
return NOERROR;
}
return HRESULT_Proc(E_NOINTERFACE);
return E_NOINTERFACE;
}

ULONG xrIDirect3DCubeTexture9::AddRef()
{
APIDEBUG("xrIDirect3DCubeTexture9::AddRef");
m_refCount++;
return ULONG_Proc(m_refCount);
return m_refCount;
}

ULONG xrIDirect3DCubeTexture9::Release()
Expand All @@ -48,9 +48,9 @@ ULONG xrIDirect3DCubeTexture9::Release()
if (m_refCount < 0)
{
delete this;
return ULONG_Proc(-1);
return -1;
}
return ULONG_Proc(m_refCount);
return m_refCount;
}

/*** IDirect3DBaseTexture9 methods ***/
Expand All @@ -59,21 +59,21 @@ HRESULT xrIDirect3DCubeTexture9::GetDevice( IDirect3DDevice9** ppDevice)
APIDEBUG("xrIDirect3DCubeTexture9::GetDevice");
m_pIDirect3DDevice9->AddRef();
*ppDevice = m_pIDirect3DDevice9;
return HRESULT_Proc(S_OK);
return S_OK;
}
HRESULT xrIDirect3DCubeTexture9::SetPrivateData ( REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) { APIDEBUG("xrIDirect3DCubeTexture9::SetPrivateData"); return HRESULT_Proc(S_OK); };
HRESULT xrIDirect3DCubeTexture9::GetPrivateData ( REFGUID refguid,void* pData,DWORD* pSizeOfData) { APIDEBUG("xrIDirect3DCubeTexture9::GetPrivateData"); return HRESULT_Proc(S_OK); };
HRESULT xrIDirect3DCubeTexture9::FreePrivateData ( REFGUID refguid) { APIDEBUG("xrIDirect3DCubeTexture9::FreePrivateData"); return HRESULT_Proc(S_OK); };
DWORD xrIDirect3DCubeTexture9::SetPriority ( DWORD PriorityNew) { APIDEBUG("xrIDirect3DCubeTexture9::SetPriority"); DWORD old = Priority; Priority = PriorityNew; return DWORD_Proc(old); };
DWORD xrIDirect3DCubeTexture9::GetPriority () { APIDEBUG("xrIDirect3DCubeTexture9::GetPriority"); return DWORD_Proc(Priority); };
void xrIDirect3DCubeTexture9::PreLoad () { APIDEBUG("xrIDirect3DCubeTexture9::PreLoad"); return VOID_proc(); };
HRESULT xrIDirect3DCubeTexture9::SetPrivateData ( REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) { APIDEBUG("xrIDirect3DCubeTexture9::SetPrivateData"); return S_OK; };
HRESULT xrIDirect3DCubeTexture9::GetPrivateData ( REFGUID refguid,void* pData,DWORD* pSizeOfData) { APIDEBUG("xrIDirect3DCubeTexture9::GetPrivateData"); return S_OK; };
HRESULT xrIDirect3DCubeTexture9::FreePrivateData ( REFGUID refguid) { APIDEBUG("xrIDirect3DCubeTexture9::FreePrivateData"); return S_OK; };
DWORD xrIDirect3DCubeTexture9::SetPriority ( DWORD PriorityNew) { APIDEBUG("xrIDirect3DCubeTexture9::SetPriority"); DWORD old = Priority; Priority = PriorityNew; return old; };
DWORD xrIDirect3DCubeTexture9::GetPriority () { APIDEBUG("xrIDirect3DCubeTexture9::GetPriority"); return Priority; };
void xrIDirect3DCubeTexture9::PreLoad () { APIDEBUG("xrIDirect3DCubeTexture9::PreLoad"); };
D3DRESOURCETYPE xrIDirect3DCubeTexture9::GetType () { APIDEBUG("xrIDirect3DCubeTexture9::GetType"); return D3DRTYPE_TEXTURE; };
DWORD xrIDirect3DCubeTexture9::SetLOD ( DWORD LODNew) { APIDEBUG("xrIDirect3DCubeTexture9::SetLOD"); DWORD old = LOD; LOD = LODNew; return DWORD_Proc(old); };
DWORD xrIDirect3DCubeTexture9::GetLOD () { APIDEBUG("xrIDirect3DCubeTexture9::GetLOD"); return DWORD_Proc(LOD); };
DWORD xrIDirect3DCubeTexture9::GetLevelCount () { APIDEBUG("xrIDirect3DCubeTexture9::GetLevelCount"); return DWORD_Proc(Levels); };
HRESULT xrIDirect3DCubeTexture9::SetAutoGenFilterType ( D3DTEXTUREFILTERTYPE iFilterType) { APIDEBUG("xrIDirect3DCubeTexture9::SetAutoGenFilterType"); FilterType = iFilterType; return HRESULT_Proc(S_OK); };
D3DTEXTUREFILTERTYPE xrIDirect3DCubeTexture9::GetAutoGenFilterType () { APIDEBUG("xrIDirect3DCubeTexture9::GetAutoGenFilterType"); return D3DTEXTUREFILTERTYPE(FilterType); };
void xrIDirect3DCubeTexture9::GenerateMipSubLevels () { APIDEBUG("xrIDirect3DCubeTexture9::GenerateMipSubLevels"); return VOID_proc(); };
DWORD xrIDirect3DCubeTexture9::SetLOD ( DWORD LODNew) { APIDEBUG("xrIDirect3DCubeTexture9::SetLOD"); DWORD old = LOD; LOD = LODNew; return old; };
DWORD xrIDirect3DCubeTexture9::GetLOD () { APIDEBUG("xrIDirect3DCubeTexture9::GetLOD"); return LOD; };
DWORD xrIDirect3DCubeTexture9::GetLevelCount () { APIDEBUG("xrIDirect3DCubeTexture9::GetLevelCount"); return Levels; };
HRESULT xrIDirect3DCubeTexture9::SetAutoGenFilterType ( D3DTEXTUREFILTERTYPE iFilterType) { APIDEBUG("xrIDirect3DCubeTexture9::SetAutoGenFilterType"); FilterType = iFilterType; return S_OK; };
D3DTEXTUREFILTERTYPE xrIDirect3DCubeTexture9::GetAutoGenFilterType () { APIDEBUG("xrIDirect3DCubeTexture9::GetAutoGenFilterType"); return FilterType; };
void xrIDirect3DCubeTexture9::GenerateMipSubLevels () { APIDEBUG("xrIDirect3DCubeTexture9::GenerateMipSubLevels"); };

HRESULT xrIDirect3DCubeTexture9::GetLevelDesc ( UINT Level,D3DSURFACE_DESC *pDesc)
{
Expand All @@ -89,7 +89,7 @@ HRESULT xrIDirect3DCubeTexture9::GetLevelDesc ( UINT Level,D3DSURFACE_DESC
pDesc->Width = Width;
pDesc->Height = Height;

return HRESULT_Proc(S_OK);
return S_OK;
};

HRESULT xrIDirect3DCubeTexture9::GetCubeMapSurface( D3DCUBEMAP_FACES FaceType,UINT Level,IDirect3DSurface9** ppCubeMapSurface)
Expand All @@ -100,8 +100,8 @@ HRESULT xrIDirect3DCubeTexture9::GetCubeMapSurface( D3DCUBEMAP_FACES FaceTyp
xrIDirect3DSurface9* I = new xrIDirect3DSurface9(m_pIDirect3DDevice9, Width,Height,Format,D3DMULTISAMPLE_TYPE(0),0);
*ppCubeMapSurface = I;

return HRESULT_Proc(S_OK);
return S_OK;
};
HRESULT xrIDirect3DCubeTexture9::LockRect ( D3DCUBEMAP_FACES FaceType, UINT Level,D3DLOCKED_RECT* pLockedRect,CONST RECT* pRect,DWORD Flags) { APIDEBUG("xrIDirect3DCubeTexture9::LockRect"); return HRESULT_Proc(S_OK); };
HRESULT xrIDirect3DCubeTexture9::UnlockRect ( D3DCUBEMAP_FACES FaceType, UINT Level) { APIDEBUG("xrIDirect3DCubeTexture9::UnlockRect"); return HRESULT_Proc(S_OK); };
HRESULT xrIDirect3DCubeTexture9::AddDirtyRect ( D3DCUBEMAP_FACES FaceType, CONST RECT* pDirtyRect) { APIDEBUG("xrIDirect3DCubeTexture9::AddDirtyRect"); return HRESULT_Proc(S_OK); };
HRESULT xrIDirect3DCubeTexture9::LockRect ( D3DCUBEMAP_FACES FaceType, UINT Level,D3DLOCKED_RECT* pLockedRect,CONST RECT* pRect,DWORD Flags) { APIDEBUG("xrIDirect3DCubeTexture9::LockRect"); return S_OK; };
HRESULT xrIDirect3DCubeTexture9::UnlockRect ( D3DCUBEMAP_FACES FaceType, UINT Level) { APIDEBUG("xrIDirect3DCubeTexture9::UnlockRect"); return S_OK; };
HRESULT xrIDirect3DCubeTexture9::AddDirtyRect ( D3DCUBEMAP_FACES FaceType, CONST RECT* pDirtyRect) { APIDEBUG("xrIDirect3DCubeTexture9::AddDirtyRect"); return S_OK; };
Loading

0 comments on commit 5defbb4

Please sign in to comment.