Skip to content

CalcSurfaceExtents: MAX_SURFACE_TEXTURE_SIZE limit increased from 256… #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading