From 643e70d5cbc78211766f0961d05a1ffc7abfd324 Mon Sep 17 00:00:00 2001 From: milek7 Date: Mon, 26 Feb 2018 18:05:53 +0100 Subject: [PATCH] texture compressing switch --- Globals.cpp | 4 ++++ Globals.h | 1 + Texture.cpp | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Globals.cpp b/Globals.cpp index 912df735..047a2f81 100644 --- a/Globals.cpp +++ b/Globals.cpp @@ -630,6 +630,10 @@ global_settings::ConfigParse(cParser &Parser) { Parser.getTokens( 1 ); Parser >> dds_upper_origin; } + else if (token == "compresstex") { + Parser.getTokens( 1 ); + Parser >> compress_tex; + } } while ((token != "") && (token != "endconfig")); //(!Parser->EndOfFile) // na koniec trochę zależności if (!bLoadTraction) // wczytywanie drutów i słupów diff --git a/Globals.h b/Globals.h index 7b1230f8..539e44c4 100644 --- a/Globals.h +++ b/Globals.h @@ -168,6 +168,7 @@ struct global_settings { std::string screenshot_dir; bool loading_log = true; bool dds_upper_origin = false; + bool compress_tex = true; // methods void LoadIniFile( std::string asFileName ); diff --git a/Texture.cpp b/Texture.cpp index 8cf8f8ad..2385d606 100644 --- a/Texture.cpp +++ b/Texture.cpp @@ -647,7 +647,7 @@ opengl_texture::create() { else { // uncompressed texture data. have the gfx card do the compression as it sees fit ::glTexImage2D( - GL_TEXTURE_2D, 0, GL_COMPRESSED_RGBA, + GL_TEXTURE_2D, 0, Global.compress_tex ? GL_COMPRESSED_RGBA : GL_RGBA, data_width, data_height, 0, data_format, GL_UNSIGNED_BYTE, (GLubyte *)&data[ 0 ] ); }