Index: binaries/data/config/default.cfg =================================================================== --- binaries/data/config/default.cfg +++ binaries/data/config/default.cfg @@ -75,6 +75,7 @@ shadowsfixed = false ; When enabled shadows are rendered only on the shadowsfixeddistance = 300.0 ; fixed distance and without swimming effect. +texturequality = 5 ; Texture resolution and quality (0 - Lowest, 1 Very Low, 2 - Low, 3 - Medium, 4 - High, 5 - Very High, 6 - Ultra) vsync = false particles = true fog = true Index: source/lib/res/graphics/ogl_tex.cpp =================================================================== --- source/lib/res/graphics/ogl_tex.cpp +++ source/lib/res/graphics/ogl_tex.cpp @@ -55,6 +55,8 @@ case GL_NEAREST_MIPMAP_LINEAR: case GL_LINEAR_MIPMAP_LINEAR: return true; + case GL_EXT_texture_filter_anisotropic: + return ogl_tex_has_anisotropy(); default: return false; } @@ -428,6 +430,7 @@ static void OglTex_init(OglTex* ot, va_list args) { + ONCE(detect_gl_upload_caps()); Tex* wrapped_tex = va_arg(args, Tex*); if(wrapped_tex) { @@ -913,8 +916,6 @@ // - frees the texel data! see ogl_tex_get_data. Status ogl_tex_upload(const Handle ht, GLenum fmt_ovr, int q_flags_ovr, GLint int_fmt_ovr) { - ONCE(detect_gl_upload_caps()); - H_DEREF(ht, OglTex, ot); Tex* t = &ot->t; ENSURE(q_flags_valid(q_flags_ovr)); Index: source/ps/GameSetup/GameSetup.cpp =================================================================== --- source/ps/GameSetup/GameSetup.cpp +++ source/ps/GameSetup/GameSetup.cpp @@ -159,9 +159,8 @@ break; // [perf] add anisotropy case 6: - // TODO: add anisotropic filtering q_flags = OGL_TEX_FULL_QUALITY; - filter = GL_LINEAR_MIPMAP_LINEAR; + filter = ogl_tex_has_anisotropy() ? GL_EXT_texture_filter_anisotropic : GL_LINEAR_MIPMAP_LINEAR; break; // invalid default: @@ -974,8 +973,14 @@ RunHardwareDetection(); - const int quality = SANE_TEX_QUALITY_DEFAULT; // TODO: set value from config file - SetTextureQuality(quality); + if (g_AtlasGameLoop && g_AtlasGameLoop->view) + SetTextureQuality(SANE_TEX_QUALITY_DEFAULT); + else + { + int textureQuality = SANE_TEX_QUALITY_DEFAULT; + CFG_GET_VAL("texturequality", textureQuality); + SetTextureQuality(textureQuality); + } ogl_WarnIfError();