DXGL r64 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r63‎ | r64 | r65 >
Date:22:33, 31 December 2011
Author:admin
Status:new
Tags:
Comment:
Add IDirect3D7::CreateDevice
Add IDirect3D7Device::GetViewport and SetViewport
Modified paths:
  • /ddraw/glDirect3D.cpp (modified) (history)
  • /ddraw/glDirect3DDevice.cpp (modified) (history)
  • /ddraw/glDirect3DDevice.h (modified) (history)

Diff [purge]

Index: ddraw/glDirect3D.cpp
@@ -56,8 +56,9 @@
5757
5858 HRESULT WINAPI glDirect3D7::CreateDevice(REFCLSID rclsid, LPDIRECTDRAWSURFACE7 lpDDS, LPDIRECT3DDEVICE7 *lplpD3DDevice)
5959 {
60 - FIXME("glDirect3D7::CreateDevice: stub");
61 - return DDERR_GENERIC;
 60+ glDirect3DDevice7 *glD3DDev7 = new glDirect3DDevice7(this,(glDirectDrawSurface7*)lpDDS);
 61+ *lplpD3DDevice = (LPDIRECT3DDEVICE7) glD3DDev7;
 62+ return D3D_OK;
6263 }
6364 HRESULT WINAPI glDirect3D7::CreateVertexBuffer(LPD3DVERTEXBUFFERDESC lpVBDesc, LPDIRECT3DVERTEXBUFFER7* lplpD3DVertexBuffer, DWORD dwFlags)
6465 {
Index: ddraw/glDirect3DDevice.cpp
@@ -28,6 +28,7 @@
2929 glD3D7->AddRef();
3030 this->glDDS7 = glDDS7;
3131 glDDS7->AddRef();
 32+ ZeroMemory(&viewport,sizeof(D3DVIEWPORT7));
3233 }
3334 glDirect3DDevice7::~glDirect3DDevice7()
3435 {
@@ -191,7 +192,7 @@
192193 FIXME("glDirect3DDevice7::GetRenderState: stub");
193194 ERR(DDERR_GENERIC);
194195 }
195 -HRESULT WINAPI glDirect3DDevice7::GetRenderTarget(LPDIRECTDRAWSURFACE7 lplpRenderTarget)
 196+HRESULT WINAPI glDirect3DDevice7::GetRenderTarget(LPDIRECTDRAWSURFACE7 *lplpRenderTarget)
196197 {
197198 FIXME("glDirect3DDevice7::GetRenderTarget: stub");
198199 ERR(DDERR_GENERIC);
@@ -218,8 +219,8 @@
219220 }
220221 HRESULT WINAPI glDirect3DDevice7::GetViewport(LPD3DVIEWPORT7 lpViewport)
221222 {
222 - FIXME("glDirect3DDevice7::GetViewport: stub");
223 - ERR(DDERR_GENERIC);
 223+ memcpy(lpViewport,&viewport,sizeof(D3DVIEWPORT7));
 224+ return D3D_OK;
224225 }
225226 HRESULT WINAPI glDirect3DDevice7::LightEnable(DWORD dwLightIndex, BOOL bEnable)
226227 {
@@ -294,8 +295,8 @@
295296 }
296297 HRESULT WINAPI glDirect3DDevice7::SetViewport(LPD3DVIEWPORT7 lpViewport)
297298 {
298 - FIXME("glDirect3DDevice7::SetViewport: stub");
299 - ERR(DDERR_GENERIC);
 299+ memcpy(&viewport,lpViewport,sizeof(D3DVIEWPORT7));
 300+ return D3D_OK;
300301 }
301302 HRESULT WINAPI glDirect3DDevice7::ValidateDevice(LPDWORD lpdwPasses)
302303 {
Index: ddraw/glDirect3DDevice.h
@@ -61,7 +61,7 @@
6262 HRESULT WINAPI GetLightEnable(DWORD dwLightIndex, BOOL* pbEnable);
6363 HRESULT WINAPI GetMaterial(LPD3DMATERIAL7 lpMaterial);
6464 HRESULT WINAPI GetRenderState(D3DRENDERSTATETYPE dwRenderStateType, LPDWORD lpdwRenderState);
65 - HRESULT WINAPI GetRenderTarget(LPDIRECTDRAWSURFACE7 lplpRenderTarget);
 65+ HRESULT WINAPI GetRenderTarget(LPDIRECTDRAWSURFACE7 *lplpRenderTarget);
6666 HRESULT WINAPI GetStateData(DWORD dwState, LPVOID* lplpStateData);
6767 HRESULT WINAPI GetTexture(DWORD dwStage, LPDIRECTDRAWSURFACE7 *lplpTexture);
6868 HRESULT WINAPI GetTextureStageState(DWORD dwStage, D3DTEXTURESTAGESTATETYPE dwState, LPDWORD lpdwValue);
@@ -89,7 +89,7 @@
9090 glDirect3D7 *glD3D7;
9191 glDirectDrawSurface7 *glDDS7;
9292 ULONG refcount;
93 -
 93+ D3DVIEWPORT7 viewport;
9494 };
9595
9696 #endif //__GLDIRECT3DDEVICE_H
\ No newline at end of file