diff --git a/engine/client/cl_screen.c b/engine/client/cl_screen.c index 527ffe7d6..b203c8f34 100644 --- a/engine/client/cl_screen.c +++ b/engine/client/cl_screen.c @@ -1857,6 +1857,7 @@ SCR_ScreenShot_f */ void SCR_ScreenShot_f (void) { + char sysname[1024]; char pcxname[80]; int i; vfsfile_t *vfs; @@ -1902,8 +1903,10 @@ void SCR_ScreenShot_f (void) } } + FS_NativePath(pcxname, FS_GAMEONLY, sysname, sizeof(sysname)); + if (SCR_ScreenShot(pcxname)) - Con_Printf ("Wrote %s\n", pcxname); + Con_Printf ("Wrote %s\n", sysname); else Con_Printf ("Screenshot failed\n"); } diff --git a/engine/client/pr_csqc.c b/engine/client/pr_csqc.c index e78050c2d..d92551411 100644 --- a/engine/client/pr_csqc.c +++ b/engine/client/pr_csqc.c @@ -606,7 +606,7 @@ static model_t *CSQC_GetModelForIndex(int index) static qboolean CopyCSQCEdictToEntity(csqcedict_t *in, entity_t *out) { - int i, ival; + int ival; model_t *model; unsigned int rflags; diff --git a/engine/client/renderer.c b/engine/client/renderer.c index 88126114a..5919a2ea2 100644 --- a/engine/client/renderer.c +++ b/engine/client/renderer.c @@ -201,8 +201,8 @@ extern cvar_t r_novis; extern cvar_t r_speeds; extern cvar_t r_waterwarp; -extern cvar_t r_polygonoffset_submodel_factor; -extern cvar_t r_polygonoffset_submodel_offset; +cvar_t r_polygonoffset_submodel_factor = SCVAR("r_polygonoffset_submodel_factor", "0.05"); +cvar_t r_polygonoffset_submodel_offset = SCVAR("r_polygonoffset_submodel_offset", "25"); rendererstate_t currentrendererstate; @@ -388,9 +388,6 @@ void GLRenderer_Init(void) // Cvar_Register (&gl_lightmapmode, GLRENDEREROPTIONS); - Cvar_Register (&r_polygonoffset_submodel_factor, GLRENDEREROPTIONS); - Cvar_Register (&r_polygonoffset_submodel_offset, GLRENDEREROPTIONS); - Cvar_Register (&gl_picmip, GLRENDEREROPTIONS); Cvar_Register (&gl_picmip2d, GLRENDEREROPTIONS); @@ -601,6 +598,8 @@ void Renderer_Init(void) Cvar_Register (&r_replacemodels, GRAPHICALNICETIES); + Cvar_Register (&r_polygonoffset_submodel_factor, GLRENDEREROPTIONS); + Cvar_Register (&r_polygonoffset_submodel_offset, GLRENDEREROPTIONS); // misc Cvar_Register(&con_ocranaleds, "Console controls"); diff --git a/engine/d3d/vid_d3d.c b/engine/d3d/vid_d3d.c index 6b7f04fc1..90acdb6c9 100644 --- a/engine/d3d/vid_d3d.c +++ b/engine/d3d/vid_d3d.c @@ -798,45 +798,58 @@ static void (D3D9_VID_ShiftPalette) (unsigned char *palette) } static char *(D3D9_VID_GetRGBInfo) (int prepad, int *truevidwidth, int *truevidheight) { - IDirect3DSurface9 *surf; + IDirect3DSurface9 *backbuf, *surf; D3DLOCKED_RECT rect; + D3DSURFACE_DESC desc; int i, j, c; - qbyte *ret = BZ_Malloc(prepad + vid.pixelwidth*vid.pixelheight*3); + qbyte *ret = NULL; qbyte *p; - HRESULT res; - // TODO: this captures the entire screen on windowed display.. - // also might break on multi-monitor - IDirect3DDevice9_CreateOffscreenPlainSurface(pD3DDev9, - GetSystemMetrics(SM_CXSCREEN), - GetSystemMetrics(SM_CYSCREEN), - D3DFMT_A8R8G8B8, - D3DPOOL_SYSTEMMEM, - &surf, - NULL); - IDirect3DDevice9_GetFrontBufferData(pD3DDev9, 0, surf); - IDirect3DSurface9_LockRect(surf, &rect, NULL, D3DLOCK_NO_DIRTY_UPDATE|D3DLOCK_READONLY|D3DLOCK_NOSYSLOCK); + /*DON'T read the front buffer. + this function can be used by the quakeworld remote screenshot 'snap' feature, + so DO NOT read the frontbuffer because it can show other information than just quake to third parties*/ - // read surface rect and convert 32 bgra to 24 rgb and flip - c = prepad+vid.pixelwidth*vid.pixelheight*3; - p = (qbyte *)rect.pBits; - - for (i=c-(3*vid.pixelwidth); i>=prepad; i-=(3*vid.pixelwidth)) + if (!FAILED(IDirect3DDevice9_GetRenderTarget(pD3DDev9, 0, &backbuf))) { - for (j=0; j=prepad; i-=(3*desc.Height)) + { + for (j=0; j