From ae55a11a1cdde836841c48fa6b1762fa64789b77 Mon Sep 17 00:00:00 2001 From: Spoike Date: Fri, 7 Feb 2014 14:57:07 +0000 Subject: [PATCH] Tweaks to fix stuff that I broke. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4599 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/merged.h | 3 +++ engine/client/pr_csqc.c | 8 ++++---- engine/client/renderer.c | 6 ++++-- engine/common/fs_zip.c | 10 ++++++---- engine/d3d/vid_d3d.c | 6 +++++- engine/d3d/vid_d3d11.c | 6 ++++++ engine/gl/gl_rmain.c | 10 +++++----- engine/gl/gl_vidcommon.c | 2 ++ engine/qclib/qccmain.c | 2 +- 9 files changed, 36 insertions(+), 17 deletions(-) diff --git a/engine/client/merged.h b/engine/client/merged.h index 88407c84b..8fcf85adb 100644 --- a/engine/client/merged.h +++ b/engine/client/merged.h @@ -343,6 +343,7 @@ typedef struct rendererinfo_s { void (*BE_VBO_Data)(vbobctx_t *ctx, void *data, unsigned int size, vboarray_t *varray); void (*BE_VBO_Finish)(vbobctx_t *ctx, void *edata, unsigned int esize, vboarray_t *earray); void (*BE_VBO_Destroy)(vboarray_t *vearray); + void (*BE_RenderToTextureUpdate2d)(qboolean destchanged); char *alignment; } rendererinfo_t; @@ -377,6 +378,8 @@ typedef struct rendererinfo_s { #define BE_VBO_Destroy rf->BE_VBO_Destroy #define BE_Scissor rf->BE_Scissor +#define BE_RenderToTextureUpdate2d rf->BE_RenderToTextureUpdate2d + texid_t R2D_RT_Configure(unsigned int id, int width, int height, uploadfmt_t rtfmt); texid_t R2D_RT_GetTexture(unsigned int id, unsigned int *width, unsigned int *height); diff --git a/engine/client/pr_csqc.c b/engine/client/pr_csqc.c index 568668651..4c6d16013 100644 --- a/engine/client/pr_csqc.c +++ b/engine/client/pr_csqc.c @@ -1551,7 +1551,7 @@ static void QCBUILTIN PF_R_SetViewFlag(pubprogfuncs_t *prinst, struct globalvars R2D_RT_Configure(*p, size[0], size[1], fmt); } r_refdef.rt_destcolour = *p; - GLBE_RenderToTextureUpdate2d(true); + BE_RenderToTextureUpdate2d(true); break; case VF_RT_SOURCECOLOUR: if (prinst->callargc >= 4) @@ -1561,7 +1561,7 @@ static void QCBUILTIN PF_R_SetViewFlag(pubprogfuncs_t *prinst, struct globalvars R2D_RT_Configure(*p, size[0], size[1], fmt); } r_refdef.rt_sourcecolour = *p; - GLBE_RenderToTextureUpdate2d(false); + BE_RenderToTextureUpdate2d(false); break; case VF_RT_DEPTH: if (prinst->callargc >= 4) @@ -1571,7 +1571,7 @@ static void QCBUILTIN PF_R_SetViewFlag(pubprogfuncs_t *prinst, struct globalvars R2D_RT_Configure(*p, size[0], size[1], fmt); } r_refdef.rt_depth = *p; - GLBE_RenderToTextureUpdate2d(false); + BE_RenderToTextureUpdate2d(false); break; case VF_RT_RIPPLE: if (prinst->callargc >= 4) @@ -1581,7 +1581,7 @@ static void QCBUILTIN PF_R_SetViewFlag(pubprogfuncs_t *prinst, struct globalvars R2D_RT_Configure(*p, size[0], size[1], fmt); } r_refdef.rt_ripplemap = *p; - GLBE_RenderToTextureUpdate2d(false); + BE_RenderToTextureUpdate2d(false); break; default: diff --git a/engine/client/renderer.c b/engine/client/renderer.c index 798d17e58..263fd101f 100644 --- a/engine/client/renderer.c +++ b/engine/client/renderer.c @@ -343,7 +343,7 @@ cvar_t r_shadow_bumpscale_bumpmap = CVARD ("r_shadow_bumpscale_bumpmap", "4", cvar_t r_glsl_offsetmapping = CVARFD ("r_glsl_offsetmapping", "0", CVAR_ARCHIVE|CVAR_SHADERSYSTEM, "Enables the use of paralax mapping, adding fake depth to textures."); cvar_t r_glsl_offsetmapping_scale = CVAR ("r_glsl_offsetmapping_scale", "0.04"); cvar_t r_glsl_offsetmapping_reliefmapping = CVARFD("r_glsl_offsetmapping_reliefmapping", "1", CVAR_ARCHIVE|CVAR_SHADERSYSTEM, "Changes the paralax sampling mode to be a bit nicer. r_glsl_offsetmapping must be set."); -//cvar_t r_glsl_turbscale = CVARF ("r_glsl_turbscale", "1", CVAR_ARCHIVE); +cvar_t r_glsl_turbscale = CVARFD ("r_glsl_turbscale", "1", CVAR_ARCHIVE, "Controls the strength of water ripples (used by the altwater glsl code)."); cvar_t r_waterstyle = CVARFD ("r_waterstyle", "1", CVAR_ARCHIVE|CVAR_SHADERSYSTEM, "Changes how water, and teleporters are drawn. Possible values are:\n0: fastturb-style block colour.\n1: regular q1-style water.\n2: refraction(ripply and transparent)\n3: refraction with reflection at an angle\n4: ripplemapped without reflections (requires particle effects)\n5: ripples+reflections"); cvar_t r_slimestyle = CVARFD ("r_slimestyle", "", CVAR_ARCHIVE|CVAR_SHADERSYSTEM, "See r_waterstyle, but affects only slime. If empty, defers to r_waterstyle."); @@ -420,7 +420,7 @@ void GLRenderer_Init(void) Cvar_Register (&r_glsl_offsetmapping, GRAPHICALNICETIES); Cvar_Register (&r_glsl_offsetmapping_scale, GRAPHICALNICETIES); Cvar_Register (&r_glsl_offsetmapping_reliefmapping, GRAPHICALNICETIES); -// Cvar_Register (&r_glsl_turbscale, GRAPHICALNICETIES); + Cvar_Register (&r_glsl_turbscale, GRAPHICALNICETIES); #ifdef R_XFLIP @@ -816,6 +816,8 @@ rendererinfo_t dedicatedrendererinfo = { NULL, NULL, + NULL, + "" }; rendererinfo_t *pdedicatedrendererinfo = &dedicatedrendererinfo; diff --git a/engine/common/fs_zip.c b/engine/common/fs_zip.c index aba430775..bee1a7a03 100644 --- a/engine/common/fs_zip.c +++ b/engine/common/fs_zip.c @@ -836,10 +836,11 @@ static qboolean FSZIP_ValidateLocalHeader(zipfile_t *zip, zpackfile_t *zfile, qo } break; default: - Con_Printf("Unknown chunk %x\n", extrachunk_tag); +/* Con_Printf("Unknown chunk %x\n", extrachunk_tag); + case 0x000a: //NTFS (timestamps) case 0x5455: //extended timestamp case 0x7875: //unix uid/gid - extra += extrachunk_len; +*/ extra += extrachunk_len; break; } } @@ -946,10 +947,11 @@ static qboolean FSZIP_ReadCentralEntry(zipfile_t *zip, qbyte *data, struct zipce } break; default: - Con_Printf("Unknown chunk %x\n", extrachunk_tag); +/* Con_Printf("Unknown chunk %x\n", extrachunk_tag); + case 0x000a: //NTFS (timestamps) case 0x5455: //extended timestamp case 0x7875: //unix uid/gid - extra += extrachunk_len; +*/ extra += extrachunk_len; break; } } diff --git a/engine/d3d/vid_d3d.c b/engine/d3d/vid_d3d.c index 152870b5d..f407c6e6b 100644 --- a/engine/d3d/vid_d3d.c +++ b/engine/d3d/vid_d3d.c @@ -1212,7 +1212,9 @@ void (D3D9_SCR_UpdateScreen) (void); - +void D3D9BE_RenderToTextureUpdate2d(qboolean destchanged) +{ +} rendererinfo_t d3d9rendererinfo = { @@ -1272,6 +1274,8 @@ rendererinfo_t d3d9rendererinfo = D3D9BE_VBO_Finish, D3D9BE_VBO_Destroy, + D3D9BE_RenderToTextureUpdate2d, + "no more" }; diff --git a/engine/d3d/vid_d3d11.c b/engine/d3d/vid_d3d11.c index 6aff31d4a..7fdc33ee3 100644 --- a/engine/d3d/vid_d3d11.c +++ b/engine/d3d/vid_d3d11.c @@ -1199,6 +1199,10 @@ static void (D3D11_R_RenderView) (void) D3D11_Set2D (); } +void D3D11BE_RenderToTextureUpdate2d(qboolean destchanged) +{ +} + rendererinfo_t d3d11rendererinfo = { "Direct3D11", @@ -1257,6 +1261,8 @@ rendererinfo_t d3d11rendererinfo = D3D11BE_VBO_Finish, D3D11BE_VBO_Destroy, + D3D11BE_RenderToTextureUpdate2d, + "no more" }; #endif diff --git a/engine/gl/gl_rmain.c b/engine/gl/gl_rmain.c index cf1f23dba..6f437c66e 100644 --- a/engine/gl/gl_rmain.c +++ b/engine/gl/gl_rmain.c @@ -994,11 +994,11 @@ void GLR_DrawPortal(batch_t *batch, batch_t **blist, batch_t *depthmasklist[2], VectorCopy(plane.normal, fp.normal); fp.dist = plane.dist; - if (DotProduct(fp.normal, vpn) < 0) - { - VectorNegate(fp.normal, fp.normal); - fp.dist *= -1; - } +// if (DotProduct(fp.normal, vpn) < 0) +// { +// VectorNegate(fp.normal, fp.normal); +// fp.dist *= -1; +// } fp.type = PLANE_ANYZ; fp.signbits = SignbitsForPlane (&fp); diff --git a/engine/gl/gl_vidcommon.c b/engine/gl/gl_vidcommon.c index 9e41333be..8595e0a37 100644 --- a/engine/gl/gl_vidcommon.c +++ b/engine/gl/gl_vidcommon.c @@ -2045,6 +2045,8 @@ rendererinfo_t openglrendererinfo = { GLBE_VBO_Finish, GLBE_VBO_Destroy, + GLBE_RenderToTextureUpdate2d, + "" }; diff --git a/engine/qclib/qccmain.c b/engine/qclib/qccmain.c index 7f1e3d349..4ae227c96 100644 --- a/engine/qclib/qccmain.c +++ b/engine/qclib/qccmain.c @@ -1975,7 +1975,7 @@ void QCC_CRC_Init(unsigned short *crcvalue) void QCC_CRC_ProcessByte(unsigned short *crcvalue, qbyte data) { - *crcvalue = (*crcvalue << 8) ^ QCC_crctable[(*crcvalue >> 8) ^ data]; + *crcvalue = ((*crcvalue << 8) ^ QCC_crctable[(*crcvalue >> 8) ^ data]) & 0xffff; } unsigned short QCC_CRC_Value(unsigned short crcvalue)