Quellcode durchsuchen

Fixed compile error.

bkaradzic vor 13 Jahren
Ursprung
Commit
4412f0f1d0
1 geänderte Dateien mit 10 neuen und 9 gelöschten Zeilen
  1. 10 9
      src/renderer_gl.cpp

+ 10 - 9
src/renderer_gl.cpp

@@ -1024,6 +1024,16 @@ namespace bgfx
 			{
 				bool decompress = TextureFormat::Unknown > dds.m_type;
 
+				if (decompress)
+				{
+					const TextureFormatInfo& tfi = s_textureFormat[TextureFormat::BGRA8];
+					internalFmt = tfi.m_internalFmt;
+					m_fmt = tfi.m_fmt;
+					m_type = tfi.m_type;
+				}
+
+				bool swizzle = GL_RGBA == m_fmt;
+
 #if BGFX_CONFIG_RENDERER_OPENGL
 				if (swizzle
 				&&  s_renderCtx.m_textureSwizzleSupport)
@@ -1034,15 +1044,6 @@ namespace bgfx
 				}
 #endif // BGFX_CONFIG_RENDERER_OPENGL
 
-				if (decompress)
-				{
-					const TextureFormatInfo& tfi = s_textureFormat[TextureFormat::BGRA8];
-					internalFmt = tfi.m_internalFmt;
-					m_fmt = tfi.m_fmt;
-					m_type = tfi.m_type;
-				}
-
-				bool swizzle = GL_RGBA == m_fmt;
 				uint8_t* bits = (uint8_t*)g_realloc(NULL, dds.m_width*dds.m_height*4);
 
 				for (uint8_t side = 0, numSides = dds.m_cubeMap ? 6 : 1; side < numSides; ++side)