From e17db971762bb129ecea63ed599b02ff38193e03 Mon Sep 17 00:00:00 2001 From: Denis Pauk Date: Sun, 15 Oct 2023 16:41:26 +0300 Subject: [PATCH] gl1: Temporary revert back Lightmap size to fix lights Fix 1ab6214f, 660f5728 --- src/client/refresh/gl1/gl1_lightmap.c | 2 +- src/client/refresh/gl1/gl1_surf.c | 4 ++-- src/client/refresh/ref_shared.h | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/client/refresh/gl1/gl1_lightmap.c b/src/client/refresh/gl1/gl1_lightmap.c index 1873abf7..858ac7ae 100644 --- a/src/client/refresh/gl1/gl1_lightmap.c +++ b/src/client/refresh/gl1/gl1_lightmap.c @@ -261,7 +261,7 @@ LM_BeginBuildingLightmaps(model_t *m) { static lightstyle_t lightstyles[MAX_LIGHTSTYLES]; int i; - unsigned dummy[128 * 128] = {0}; + unsigned dummy[BLOCK_WIDTH * BLOCK_HEIGHT] = {0}; memset(gl_lms.allocated, 0, sizeof(gl_lms.allocated)); diff --git a/src/client/refresh/gl1/gl1_surf.c b/src/client/refresh/gl1/gl1_surf.c index c5a305a5..dff574f8 100644 --- a/src/client/refresh/gl1/gl1_surf.c +++ b/src/client/refresh/gl1/gl1_surf.c @@ -373,7 +373,7 @@ R_BlendLightmaps(const model_t *currentmodel) base += (surf->dlight_t * BLOCK_WIDTH + surf->dlight_s) * LIGHTMAP_BYTES; - RI_BuildLightMap(surf, base, BLOCK_WIDTH * LIGHTMAP_BYTES, + R_BuildLightMap(surf, base, BLOCK_WIDTH * LIGHTMAP_BYTES, &r_newrefdef, r_modulate->value, r_framecount); } } @@ -508,7 +508,7 @@ R_RenderBrushPoly(entity_t *currententity, msurface_t *fa) smax = (fa->extents[0] >> fa->lmshift) + 1; tmax = (fa->extents[1] >> fa->lmshift) + 1; - RI_BuildLightMap(fa, (void *)temp, smax * 4, + R_BuildLightMap(fa, (void *)temp, smax * 4, &r_newrefdef, r_modulate->value, r_framecount); R_SetCacheState(fa, &r_newrefdef); diff --git a/src/client/refresh/ref_shared.h b/src/client/refresh/ref_shared.h index 21e6bf5e..a2fbdbfb 100644 --- a/src/client/refresh/ref_shared.h +++ b/src/client/refresh/ref_shared.h @@ -274,8 +274,8 @@ typedef struct msurface_s enum { // width and height used to be 128, so now we should be able to get the same lightmap data // that used 32 lightmaps before into one, so 4 lightmaps should be enough - BLOCK_WIDTH = 1024, - BLOCK_HEIGHT = 512, + BLOCK_WIDTH = 128, + BLOCK_HEIGHT = 128, LIGHTMAP_BYTES = 4, };