Skip to content

Commit

Permalink
CalcSurfaceExtents: MAX_SURFACE_TEXTURE_SIZE limit increased from 256…
Browse files Browse the repository at this point in the history
… to 512
  • Loading branch information
s1lentq committed Sep 24, 2024
1 parent 7073363 commit b29740c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion rehlds/engine/model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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__);
}
}
Expand Down
7 changes: 7 additions & 0 deletions rehlds/public/rehlds/model.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit b29740c

Please sign in to comment.