From b29740c19e8cfe7a1ee0605cadccd05b35e8678e Mon Sep 17 00:00:00 2001 From: s1lentq Date: Wed, 25 Sep 2024 02:02:44 +0700 Subject: [PATCH] CalcSurfaceExtents: MAX_SURFACE_TEXTURE_SIZE limit increased from 256 to 512 --- rehlds/engine/model.cpp | 2 +- rehlds/public/rehlds/model.h | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/rehlds/engine/model.cpp b/rehlds/engine/model.cpp index 12bd90fd7..162e4c5ce 100644 --- a/rehlds/engine/model.cpp +++ b/rehlds/engine/model.cpp @@ -891,7 +891,7 @@ void CalcSurfaceExtents(msurface_t *s) s->texturemins[i] = bmins[i] * 16; s->extents[i] = (bmaxs[i] - bmins[i]) * 16; - if (!(tex->flags & TEX_SPECIAL) && s->extents[i] > 256) + if (!(tex->flags & TEX_SPECIAL) && s->extents[i] > MAX_SURFACE_TEXTURE_SIZE) Sys_Error("%s: Bad surface extents", __func__); } } diff --git a/rehlds/public/rehlds/model.h b/rehlds/public/rehlds/model.h index bcb952a9e..d0078bb7c 100644 --- a/rehlds/public/rehlds/model.h +++ b/rehlds/public/rehlds/model.h @@ -144,6 +144,13 @@ struct msurface_s // surface generation data struct surfcache_s *cachespots[MIPLEVELS]; + // Maximum s/t texture size on the surface +#if defined(GLQUAKE) || defined(SWDS) + #define MAX_SURFACE_TEXTURE_SIZE 512 +#else + #define MAX_SURFACE_TEXTURE_SIZE 256 // Software rendering is limited to 256 +#endif + short texturemins[2]; // smallest s/t position on the surface. short extents[2]; // ?? s/t texture size, 1..256 for all non-sky surfaces