DXGL r320 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r319‎ | r320 | r321 >
Date:17:06, 8 February 2013
Author:admin
Status:new
Tags:
Comment:
Implement IDirect3DTexture::Load
Modified paths:
  • /ddraw/glDirect3DTexture.cpp (modified) (history)
  • /ddraw/glDirectDrawSurface.cpp (modified) (history)
  • /ddraw/glDirectDrawSurface.h (modified) (history)

Diff [purge]

Index: ddraw/glDirect3DTexture.cpp
@@ -76,8 +76,8 @@
7777 HRESULT WINAPI glDirect3DTexture2::Load(LPDIRECT3DTEXTURE2 lpD3DTexture2)
7878 {
7979 if(!this) return DDERR_INVALIDOBJECT;
80 - FIXME("glDirect3DTexture2::Load: stub");
81 - return DDERR_GENERIC;
 80+ if(!lpD3DTexture2) return DDERR_INVALIDPARAMS;
 81+ return glDDS7->Load(((glDirect3DTexture2*)lpD3DTexture2)->GetDDS7());
8282 }
8383 HRESULT WINAPI glDirect3DTexture2::PaletteChanged(DWORD dwStart, DWORD dwCount)
8484 {
@@ -140,8 +140,8 @@
141141 HRESULT WINAPI glDirect3DTexture1::Load(LPDIRECT3DTEXTURE lpD3DTexture)
142142 {
143143 if(!this) return DDERR_INVALIDOBJECT;
144 - FIXME("glDirect3DTexture1::Load: stub");
145 - return DDERR_GENERIC;
 144+ if(!lpD3DTexture) return DDERR_INVALIDPARAMS;
 145+ return glDDS7->Load(((glDirect3DTexture1*)lpD3DTexture)->GetDDS7());
146146 }
147147 HRESULT WINAPI glDirect3DTexture1::PaletteChanged(DWORD dwStart, DWORD dwCount)
148148 {
@@ -152,6 +152,5 @@
153153 HRESULT WINAPI glDirect3DTexture1::Unload()
154154 {
155155 if(!this) return DDERR_INVALIDOBJECT;
156 - FIXME("glDirect3DTexture1::Unload: stub");
157 - return DDERR_GENERIC;
 156+ return DDERR_UNSUPPORTED;
158157 }
Index: ddraw/glDirectDrawSurface.cpp
@@ -1234,6 +1234,16 @@
12351235 return D3D_OK;
12361236 }
12371237
 1238+HRESULT glDirectDrawSurface7::Load(glDirectDrawSurface7 *src)
 1239+{
 1240+ if(!this) return DDERR_INVALIDOBJECT;
 1241+ if(!src) return DDERR_INVALIDPARAMS;
 1242+ this->Blt(NULL,src,NULL,DDBLT_WAIT,NULL);
 1243+ ddsd.ddsCaps.dwCaps &= ~DDSCAPS_ALLOCONLOAD;
 1244+ return D3D_OK;
 1245+}
 1246+
 1247+
12381248 // DDRAW1 wrapper
12391249 glDirectDrawSurface1::glDirectDrawSurface1(glDirectDrawSurface7 *gl_DDS7)
12401250 {
Index: ddraw/glDirectDrawSurface.h
@@ -108,6 +108,7 @@
109109 // Special ddraw2->ddraw7 api
110110 HRESULT WINAPI Unlock2(LPVOID lpSurfaceData);
111111 HRESULT GetHandle(glDirect3DDevice7 *glD3DDev7, LPD3DTEXTUREHANDLE lpHandle);
 112+ HRESULT Load(glDirectDrawSurface7 *src);
112113 glDirectDrawSurface1 *dds1;
113114 glDirectDrawSurface2 *dds2;
114115 glDirectDrawSurface3 *dds3;