From 3e0e4c43a81575c51ae211f1bf00bfdc324d03af Mon Sep 17 00:00:00 2001 From: Spoike Date: Sun, 11 Oct 2015 12:01:29 +0000 Subject: [PATCH] git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4991 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/cl_ents.c | 2 ++ engine/d3d/d3d11_backend.c | 4 ++-- engine/d3d/d3d_backend.c | 17 +++++++++-------- engine/gl/gl_rlight.c | 6 +++++- 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/engine/client/cl_ents.c b/engine/client/cl_ents.c index d2256d68d..3cb23782b 100644 --- a/engine/client/cl_ents.c +++ b/engine/client/cl_ents.c @@ -105,8 +105,10 @@ void CL_FreeDlights(void) if (cl_dlights[i].worldshadowmesh) SH_FreeShadowMesh(cl_dlights[i].worldshadowmesh); +#ifdef GLQUAKE if (cl_dlights[i].coronaocclusionquery) qglDeleteQueriesARB(1, &cl_dlights[i].coronaocclusionquery); +#endif } #endif diff --git a/engine/d3d/d3d11_backend.c b/engine/d3d/d3d11_backend.c index 3e0049b16..3b4b6c235 100644 --- a/engine/d3d/d3d11_backend.c +++ b/engine/d3d/d3d11_backend.c @@ -2667,8 +2667,8 @@ static void BE_UploadLightmaps(qboolean force) { lightmap[i]->rectchange.l = 0; lightmap[i]->rectchange.t = 0; - lightmap[i]->rectchange.w = lightmap[i]->width; - lightmap[i]->rectchange.h = lightmap[i]->height; + lightmap[i]->rectchange.r = lightmap[i]->width; + lightmap[i]->rectchange.b = lightmap[i]->height; lightmap[i]->modified = true; } diff --git a/engine/d3d/d3d_backend.c b/engine/d3d/d3d_backend.c index 35652bf31..0a425e0ad 100644 --- a/engine/d3d/d3d_backend.c +++ b/engine/d3d/d3d_backend.c @@ -2752,8 +2752,8 @@ static void BE_UploadLightmaps(qboolean force) { lm->rectchange.l = 0; lm->rectchange.t = 0; - lm->rectchange.w = lm->width; - lm->rectchange.h = lm->height; + lm->rectchange.r = lm->width; + lm->rectchange.b = lm->height; } if (lightmap[i]->modified) @@ -2764,6 +2764,7 @@ static void BE_UploadLightmaps(qboolean force) RECT rect; glRect_t *theRect = &lm->rectchange; int r; + int w; if (!TEXLOADED(lm->lightmap_texture)) lm->lightmap_texture = Image_CreateTexture("***lightmap***", NULL, (gl_lightmap_nearest.ival?IF_NEAREST:IF_LINEAR)|IF_NOMIPMAP); @@ -2779,20 +2780,20 @@ static void BE_UploadLightmaps(qboolean force) lm->modified = 0; rect.left = theRect->l; - rect.right = theRect->l + theRect->w; + rect.right = theRect->r; rect.top = theRect->t; - rect.bottom = theRect->t + theRect->h; + rect.bottom = theRect->b; IDirect3DTexture9_LockRect(tex, 0, &lock, &rect, 0); - for (r = 0; r < lightmap[i]->rectchange.h; r++) + for (r = 0, w = theRect->r-theRect->l; r < lightmap[i]->rectchange.b-lightmap[i]->rectchange.t; r++) { - memcpy((char*)lock.pBits + r*lock.Pitch, lightmap[i]->lightmaps+(theRect->l+((r+theRect->t)*lm->width))*lightmap_bytes, lightmap[i]->rectchange.w*lightmap_bytes); + memcpy((char*)lock.pBits + r*lock.Pitch, lightmap[i]->lightmaps+(theRect->l+((r+theRect->t)*lm->width))*lightmap_bytes, w*lightmap_bytes); } IDirect3DTexture9_UnlockRect(tex, 0); theRect->l = lm->width; theRect->t = lm->height; - theRect->h = 0; - theRect->w = 0; + theRect->r = 0; + theRect->b = 0; } } } diff --git a/engine/gl/gl_rlight.c b/engine/gl/gl_rlight.c index 48261df41..7d216aeec 100644 --- a/engine/gl/gl_rlight.c +++ b/engine/gl/gl_rlight.c @@ -418,7 +418,11 @@ void R_RenderDlights (void) method = r_coronas_occlusion.ival; if (method == 3 && qrenderer != QR_OPENGL) method = 1; - if (method == 4 && (qrenderer != QR_OPENGL || !qglGenQueriesARB)) + if (method == 4 +#ifdef GLQUAKE + && (qrenderer != QR_OPENGL || !qglGenQueriesARB) +#endif + ) method = 1; switch(method)