From 7d23dd49afce28edff7f7dac0a765b91970e16d0 Mon Sep 17 00:00:00 2001 From: James R Date: Sat, 9 Mar 2024 16:14:53 -0800 Subject: [PATCH] Let base game textures be 4096x4096 max, print developer warning in DEVELOP - In the future we should make sure no textures exceed 2048x2048, but this fine for release - The warning will not show up in release builds --- src/r_textures.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/r_textures.c b/src/r_textures.c index e3df88b82..d0aef77d9 100644 --- a/src/r_textures.c +++ b/src/r_textures.c @@ -1288,7 +1288,26 @@ Rloadtextures (INT32 i, INT32 w) height = SHORT(patchlump.height); } - if (width > 2048 || height > 2048) + INT32 sizeLimit = 2048; + if (w <= mainwads) + { + // TODO: we ran out of time to do this properly. + // 4096 limit on textures may be incompatible with some older graphics cards (circa 2005-2008?). + // This only a consideration for Legacy GL at the moment -- these will still work in Software. + // In the future, we may rely more on hardware rendering and this would become a problem. + sizeLimit = 4096; +#ifdef DEVELOP + if ((width > 2048 && width < sizeLimit) || (height > 2048 && height < sizeLimit)) + { + R_InsertTextureWarning( + " \x87(2.x developer warning, will not appear on release)\n" + "\x87These textures should ideally not be larger than 2048x2048:\n", + va("\x86%s", wadfiles[wadnum]->lumpinfo[lumpnum].fullname) + ); + } +#endif + } + if (width > sizeLimit || height > sizeLimit) { // This is INTENTIONAL. Even if software can handle it, very old GL hardware will not. // For the sake of a compatibility baseline, we will not allow anything larger than this.