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

saved snapshot correctly.
This commit is contained in:
Jason Edmeades 2003-06-04 22:51:14 +00:00 committed by Alexandre Julliard
parent 8bde56dad0
commit bca452eea6
1 changed files with 3 additions and 3 deletions

View File

@ -208,7 +208,7 @@ HRESULT WINAPI IDirect3DSurface8Impl_LockRect(LPDIRECT3DSURFACE8 iface, D3DLOCKE
1,
D3DFmt2GLFmt(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");
}
}
@ -507,7 +507,7 @@ HRESULT WINAPI IDirect3DSurface8Impl_LoadTexture(LPDIRECT3DSURFACE8 iface, GLenu
char buffer[4096];
++gen;
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);
}
}
@ -520,7 +520,7 @@ HRESULT WINAPI IDirect3DSurface8Impl_LoadTexture(LPDIRECT3DSURFACE8 iface, GLenu
#include <errno.h>
HRESULT WINAPI IDirect3DSurface8Impl_SaveSnapshot(LPDIRECT3DSURFACE8 iface, const char* filename) {
FILE* f = NULL;
int i;
ULONG i;
ICOM_THIS(IDirect3DSurface8Impl,iface);
f = fopen(filename, "w+");