Commit bca452ee authored by Jason Edmeades's avatar Jason Edmeades Committed by Alexandre Julliard

Fix the glRead call when pRect != NULL, resolve the file format of the

saved snapshot correctly.
parent 8bde56da
...@@ -208,7 +208,7 @@ HRESULT WINAPI IDirect3DSurface8Impl_LockRect(LPDIRECT3DSURFACE8 iface, D3DLOCKE ...@@ -208,7 +208,7 @@ HRESULT WINAPI IDirect3DSurface8Impl_LockRect(LPDIRECT3DSURFACE8 iface, D3DLOCKE
1, 1,
D3DFmt2GLFmt(This->Device, This->myDesc.Format), D3DFmt2GLFmt(This->Device, This->myDesc.Format),
D3DFmt2GLType(This->Device, This->myDesc.Format), D3DFmt2GLType(This->Device, This->myDesc.Format),
pLockedRect->pBits + j * pLockedRect->Pitch); (char *)pLockedRect->pBits + (pLockedRect->Pitch * (j-This->lockedRect.top)));
vcheckGLcall("glReadPixels"); vcheckGLcall("glReadPixels");
} }
} }
...@@ -507,7 +507,7 @@ HRESULT WINAPI IDirect3DSurface8Impl_LoadTexture(LPDIRECT3DSURFACE8 iface, GLenu ...@@ -507,7 +507,7 @@ HRESULT WINAPI IDirect3DSurface8Impl_LoadTexture(LPDIRECT3DSURFACE8 iface, GLenu
char buffer[4096]; char buffer[4096];
++gen; ++gen;
if ((gen % 10) == 0) { if ((gen % 10) == 0) {
snprintf(buffer, sizeof(buffer), "/tmp/surface%u_level%u_%u.png", gl_target, gl_level, gen); snprintf(buffer, sizeof(buffer), "/tmp/surface%u_level%u_%u.ppm", gl_target, gl_level, gen);
IDirect3DSurface8Impl_SaveSnapshot((LPDIRECT3DSURFACE8) This, buffer); IDirect3DSurface8Impl_SaveSnapshot((LPDIRECT3DSURFACE8) This, buffer);
} }
} }
...@@ -520,7 +520,7 @@ HRESULT WINAPI IDirect3DSurface8Impl_LoadTexture(LPDIRECT3DSURFACE8 iface, GLenu ...@@ -520,7 +520,7 @@ HRESULT WINAPI IDirect3DSurface8Impl_LoadTexture(LPDIRECT3DSURFACE8 iface, GLenu
#include <errno.h> #include <errno.h>
HRESULT WINAPI IDirect3DSurface8Impl_SaveSnapshot(LPDIRECT3DSURFACE8 iface, const char* filename) { HRESULT WINAPI IDirect3DSurface8Impl_SaveSnapshot(LPDIRECT3DSURFACE8 iface, const char* filename) {
FILE* f = NULL; FILE* f = NULL;
int i; ULONG i;
ICOM_THIS(IDirect3DSurface8Impl,iface); ICOM_THIS(IDirect3DSurface8Impl,iface);
f = fopen(filename, "w+"); f = fopen(filename, "w+");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment