DXGL r368 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r367‎ | r368 | r369 >
Date:22:50, 20 April 2013
Author:admin
Status:new
Tags:
Comment:
Remove dependency on DDraw objects in IDirect3D objects - not needed.
Modified paths:
  • /ddraw/glDirect3D.cpp (modified) (history)
  • /ddraw/glDirect3D.h (modified) (history)
  • /ddraw/glDirectDraw.cpp (modified) (history)

Diff [purge]

Index: ddraw/glDirect3D.cpp
@@ -193,12 +193,10 @@
194194 "DXGL D3D T&L HAL",
195195 }
196196 };
197 -glDirect3D7::glDirect3D7(glDirectDraw7 *glDD7)
 197+glDirect3D7::glDirect3D7()
198198 {
199 - TRACE_ENTER(2,14,this,14,glDD7);
 199+ TRACE_ENTER(1,14,this);
200200 refcount=1;
201 - this->glDD7 = glDD7;
202 - glDD7->AddRef();
203201 glD3D3 = NULL;
204202 glD3D2 = NULL;
205203 glD3D1 = NULL;
@@ -210,7 +208,7 @@
211209 TRACE_ENTER(1,14,this);
212210 if(glD3D3) glD3D3->Release();
213211 if(glD3D2) glD3D2->Release();
214 - glDD7->Release();
 212+ if(glD3D1) glD3D1->Release();
215213 TRACE_EXIT(-1,0);
216214 }
217215
Index: ddraw/glDirect3D.h
@@ -29,7 +29,7 @@
3030 class glDirect3D7 : public IDirect3D7
3131 {
3232 public:
33 - glDirect3D7(glDirectDraw7 *glDD7);
 33+ glDirect3D7();
3434 virtual ~glDirect3D7();
3535 HRESULT WINAPI QueryInterface(REFIID riid, void** ppvObj);
3636 ULONG WINAPI AddRef();
@@ -44,7 +44,6 @@
4545 HRESULT WINAPI EnumZBufferFormats(REFCLSID riidDevice, LPD3DENUMPIXELFORMATSCALLBACK lpEnumCallback, LPVOID lpContext);
4646 HRESULT WINAPI EvictManagedTextures();
4747 HRESULT WINAPI FindDevice(LPD3DFINDDEVICESEARCH lpD3DFDS, LPD3DFINDDEVICERESULT lpD3DFDR);
48 - glDirectDraw7 *glDD7;
4948 glDirect3D3 *glD3D3;
5049 glDirect3D2 *glD3D2;
5150 glDirect3D1 *glD3D1;
Index: ddraw/glDirectDraw.cpp
@@ -697,7 +697,7 @@
698698 }
699699 if(riid == IID_IDirect3D)
700700 {
701 - glDirect3D7 *tmp = new glDirect3D7(this);
 701+ glDirect3D7 *tmp = new glDirect3D7;
702702 tmp->QueryInterface(IID_IDirect3D,ppvObj);
703703 tmp->Release();
704704 TRACE_VAR("*ppvObj",14,*ppvObj);
@@ -706,7 +706,7 @@
707707 }
708708 if(riid == IID_IDirect3D2)
709709 {
710 - glDirect3D7 *tmp = new glDirect3D7(this);
 710+ glDirect3D7 *tmp = new glDirect3D7;
711711 tmp->QueryInterface(IID_IDirect3D2,ppvObj);
712712 tmp->Release();
713713 TRACE_VAR("*ppvObj",14,*ppvObj);
@@ -715,7 +715,7 @@
716716 }
717717 if(riid == IID_IDirect3D3)
718718 {
719 - glDirect3D7 *tmp = new glDirect3D7(this);
 719+ glDirect3D7 *tmp = new glDirect3D7;
720720 tmp->QueryInterface(IID_IDirect3D3,ppvObj);
721721 tmp->Release();
722722 TRACE_VAR("*ppvObj",14,*ppvObj);
@@ -724,7 +724,7 @@
725725 }
726726 if(riid == IID_IDirect3D7)
727727 {
728 - *ppvObj = new glDirect3D7(this);
 728+ *ppvObj = new glDirect3D7;
729729 TRACE_VAR("*ppvObj",14,*ppvObj);
730730 TRACE_EXIT(23,DD_OK);
731731 return DD_OK;