From dafc41f5099ef26c5fcfe11c10a6b9570967a5c1 Mon Sep 17 00:00:00 2001 From: Yamagi Burmeister Date: Sat, 6 Aug 2016 10:37:24 +0200 Subject: [PATCH] Switch GL_ARB_texture_non_power_of_two to our new probing logic. While at it rename R_Upload32Old to R_Upload32Soft. --- src/client/refresh/header/local.h | 4 +++- src/client/refresh/r_image.c | 6 +++--- src/client/refresh/r_main.c | 17 ++++++++++++++--- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/src/client/refresh/header/local.h b/src/client/refresh/header/local.h index 2b8bd1f0..396331eb 100644 --- a/src/client/refresh/header/local.h +++ b/src/client/refresh/header/local.h @@ -382,9 +382,11 @@ typedef struct // ---- qboolean anisotropic; + qboolean npottextures; qboolean palettedtexture; qboolean pointparameters; + qboolean mtexcombine; // ---- @@ -392,7 +394,7 @@ typedef struct float max_anisotropy; - qboolean tex_npot; + } glconfig_t; typedef struct diff --git a/src/client/refresh/r_image.c b/src/client/refresh/r_image.c index be100b06..c2cdc1a8 100644 --- a/src/client/refresh/r_image.c +++ b/src/client/refresh/r_image.c @@ -665,7 +665,7 @@ R_Upload32Native(unsigned *data, int width, int height, qboolean mipmap) qboolean -R_Upload32Old(unsigned *data, int width, int height, qboolean mipmap) +R_Upload32Soft(unsigned *data, int width, int height, qboolean mipmap) { int samples; unsigned scaled[256 * 256]; @@ -850,13 +850,13 @@ R_Upload32(unsigned *data, int width, int height, qboolean mipmap) { qboolean res; - if (gl_config.tex_npot) + if (gl_config.npottextures) { res = R_Upload32Native(data, width, height, mipmap); } else { - res = R_Upload32Old(data, width, height, mipmap); + res = R_Upload32Soft(data, width, height, mipmap); } if (mipmap) diff --git a/src/client/refresh/r_main.c b/src/client/refresh/r_main.c index 9523af3c..5f74df5f 100644 --- a/src/client/refresh/r_main.c +++ b/src/client/refresh/r_main.c @@ -1537,16 +1537,27 @@ R_Init(void *hinstance, void *hWnd) gl_config.max_anisotropy = 0.0; Cvar_SetValue("gl_anisotropic_avail", 0.0); - VID_Printf(PRINT_ALL, "failed\n"); + VID_Printf(PRINT_ALL, "Failed\n"); } // ---- + /* Non power of two textures */ + VID_Printf(PRINT_ALL, " - Non power of two textures: "); + + if (strstr(gl_config.extensions_string, "GL_ARB_texture_non_power_of_two")) { - VID_Printf(PRINT_ALL, "...using GL_ARB_texture_non_power_of_two\n"); - gl_config.tex_npot = true; + gl_config.npottextures = true; + VID_Printf(PRINT_ALL, "Okay\n"); } + else + { + gl_config.npottextures = false; + VID_Printf(PRINT_ALL, "Failed\n"); + } + + // ---- gl_config.mtexcombine = false;