As some of you might know, OpenGL drivers using Mesa don't support compression of S3TC textures since the encoding algorithm is patented; since the GL_EXT_texture_compression_s3tc extension requires the driver to do this as well as accept precompressed textures, Mesa doesn't advertise the extension. This makes FSO not work with Mesa unless the legally questionable libtxc_dxtn library is used.
But since the MediaVPs only use precompressed S3TC textures, FSO doesn't care whether the driver can encode S3TC textures, and Mesa can handle precompressed textures with no problem. There is a driconf option called force_s3tc_enable that makes Mesa advertise S3TC support even without libtxc_dxtn present. The following patch makes FSO set that environment variable before creating an OpenGL context for the first time:
diff --git a/code/graphics/gropengl.cpp b/code/graphics/gropengl.cpp
index 47a5737..2e5ede6 100644
--- a/code/graphics/gropengl.cpp
+++ b/code/graphics/gropengl.cpp
@@ -1659,6 +1659,9 @@ int opengl_init_display_device()
SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, (fsaa_samples == 0) ? 0 : 1);
SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, fsaa_samples);
+
+ // Slight hack to make Mesa advertise S3TC support without libtxc_dxtn
+ setenv("force_s3tc_enable", "true", 1);
mprintf((" Requested SDL Video values = R: %d, G: %d, B: %d, depth: %d, double-buffer: %d, FSAA: %d\n", Gr_red.bits, Gr_green.bits, Gr_blue.bits, (bpp == 32) ? 24 : 16, db, fsaa_samples));
This should work out of the box with all Mesa DRI drivers - in other words, for people using Intel hardware on Linux, and some Radeon users with the older driver. The only problem with this is that Gallium drivers (used for the open-source Nvidia and AMD drivers) don't currently support the force_s3tc_enable environment variable. However, I sent 2 small patches to the Mesa mailing list earlier today that fix this shortcoming in Gallium. So it's likely that this fix will work for Gallium drivers as well in the future.