From c3dd09cebfeca29a33ab77dfcfb27ec7a64a9687 Mon Sep 17 00:00:00 2001 From: BeaR Date: Mon, 27 Aug 2012 18:58:30 +0200 Subject: [PATCH] Readded Texturecompression-support --- src/engine/client/backend_sdl.cpp | 10 ++++++++++ src/engine/client/graphics_threaded.h | 1 + 2 files changed, 11 insertions(+) diff --git a/src/engine/client/backend_sdl.cpp b/src/engine/client/backend_sdl.cpp index 22c48e53d..7fa1db77a 100644 --- a/src/engine/client/backend_sdl.cpp +++ b/src/engine/client/backend_sdl.cpp @@ -176,6 +176,16 @@ void CCommandProcessorFragment_OpenGL::Cmd_Texture_Create(const CCommandBuffer:: int Oglformat = TexFormatToOpenGLFormat(pCommand->m_Format); int StoreOglformat = TexFormatToOpenGLFormat(pCommand->m_StoreFormat); + if(pCommand->m_Flags&CCommandBuffer::TEXFLAG_COMPRESSED) + { + switch(StoreOglformat) + { + case GL_RGB: StoreOglformat = GL_COMPRESSED_RGB_ARB; + case GL_ALPHA: StoreOglformat = GL_COMPRESSED_ALPHA_ARB; + case GL_RGBA: StoreOglformat = GL_COMPRESSED_RGBA_ARB; + default: StoreOglformat = GL_COMPRESSED_RGBA_ARB; + } + } glGenTextures(1, &m_aTextures[pCommand->m_Slot]); glBindTexture(GL_TEXTURE_2D, m_aTextures[pCommand->m_Slot]); diff --git a/src/engine/client/graphics_threaded.h b/src/engine/client/graphics_threaded.h index 5c15d0629..e482f6e5d 100644 --- a/src/engine/client/graphics_threaded.h +++ b/src/engine/client/graphics_threaded.h @@ -94,6 +94,7 @@ public: TEXFORMAT_ALPHA, TEXFLAG_NOMIPMAPS = 1, + TEXFLAG_COMPRESSED = 2, }; enum