Added video settings filter options via config file - second try :-)
authorVanessa Ezekowitz <vanessaezekowitz@gmail.com>
Sun, 4 Nov 2012 15:51:40 +0000 (10:51 -0500)
committerPerttu Ahola <celeron55@gmail.com>
Fri, 9 Nov 2012 17:12:44 +0000 (19:12 +0200)
Set one or more of these in the config to turn the related option on:

mip_map = 1
anisotropic_filter = 1
bilinear_filter = 1
trilinear_filter = 1

src/clientmap.cpp
src/defaultsettings.cpp
src/guiMainMenu.h
src/main.cpp

index 64d5656d46135a263a4719d14d349e58cb829ed2..02c9fe9b1db78ecadbbf9518545a2fec7959d40d 100644 (file)
@@ -413,6 +413,10 @@ void ClientMap::renderMap(video::IVideoDriver* driver, s32 pass)
                m_last_drawn_sectors.clear();
        }
 
+       bool use_trilinear_filter = g_settings->getBool("trilinear_filter");
+       bool use_bilinear_filter = g_settings->getBool("bilinear_filter");
+       bool use_anisotropic_filter = g_settings->getBool("anisotropic_filter");
+
        /*
                Get time for measuring timeout.
                
@@ -544,6 +548,11 @@ void ClientMap::renderMap(video::IVideoDriver* driver, s32 pass)
                        for(u32 i=0; i<c; i++)
                        {
                                scene::IMeshBuffer *buf = mesh->getMeshBuffer(i);
+
+                               buf->getMaterial().setFlag(video::EMF_TRILINEAR_FILTER, use_trilinear_filter);
+                               buf->getMaterial().setFlag(video::EMF_BILINEAR_FILTER, use_bilinear_filter);
+                               buf->getMaterial().setFlag(video::EMF_ANISOTROPIC_FILTER, use_anisotropic_filter);
+
                                const video::SMaterial& material = buf->getMaterial();
                                video::IMaterialRenderer* rnd =
                                                driver->getMaterialRenderer(material.MaterialType);
index 3b37c18dce6e200b6498f4648944e6840ddf341a..6eaa284101f37b176410379145cc4292f2751d68 100644 (file)
@@ -142,5 +142,10 @@ void set_default_settings(Settings *settings)
        settings->setDefault("full_block_send_enable_min_time_from_building", "2.0");
        settings->setDefault("dedicated_server_step", "0.05");
        settings->setDefault("ignore_world_load_errors", "false");
+       settings->setDefault("mip_map", "false");
+       settings->setDefault("anisotropic_filter", "false");
+       settings->setDefault("bilinear_filter", "false");
+       settings->setDefault("trilinear_filter", "false");
+
 }
 
index 715deb47d015cb565d1a31285dbd6c824ce24734..abfc6bdb494141d4582fb1a7ecab9c5c3cfe2098 100644 (file)
@@ -41,6 +41,10 @@ struct MainMenuData
        bool smooth_lighting;
        bool clouds_3d;
        bool opaque_water;
+       bool mip_map;
+       bool anisotropic_filter;
+       bool bilinear_filter;
+       bool trilinear_filter;
        // Server options
        bool creative_mode;
        bool enable_damage;
index 6075e9d100752f1cebbc3a1d98cab8c9aa788f2a..dcc47cd6b8cae56a75f5148bd9ed1be0040e8e4e 100644 (file)
@@ -1292,9 +1292,6 @@ int main(int argc, char *argv[])
 
        video::IVideoDriver* driver = device->getVideoDriver();
 
-       // Disable mipmaps (because some of them look ugly)
-       driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, false);
-
        /*
                This changes the minimum allowed number of vertices in a VBO.
                Default is 500.
@@ -1439,6 +1436,11 @@ int main(int argc, char *argv[])
                                menudata.smooth_lighting = g_settings->getBool("smooth_lighting");
                                menudata.clouds_3d = g_settings->getBool("enable_3d_clouds");
                                menudata.opaque_water = g_settings->getBool("opaque_water");
+                               menudata.mip_map = g_settings->getBool("mip_map");
+                               menudata.anisotropic_filter = g_settings->getBool("anisotropic_filter");
+                               menudata.bilinear_filter = g_settings->getBool("bilinear_filter");
+                               menudata.trilinear_filter = g_settings->getBool("trilinear_filter");
+                               driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, menudata.mip_map);
                                menudata.creative_mode = g_settings->getBool("creative_mode");
                                menudata.enable_damage = g_settings->getBool("enable_damage");
                                // Default to selecting nothing
@@ -1552,6 +1554,12 @@ int main(int argc, char *argv[])
                                g_settings->set("smooth_lighting", itos(menudata.smooth_lighting));
                                g_settings->set("enable_3d_clouds", itos(menudata.clouds_3d));
                                g_settings->set("opaque_water", itos(menudata.opaque_water));
+
+                               g_settings->set("mip_map", itos(menudata.mip_map));
+                               g_settings->set("anisotropic_filter", itos(menudata.anisotropic_filter));
+                               g_settings->set("bilinear_filter", itos(menudata.bilinear_filter));
+                               g_settings->set("trilinear_filter", itos(menudata.trilinear_filter));
+
                                g_settings->set("creative_mode", itos(menudata.creative_mode));
                                g_settings->set("enable_damage", itos(menudata.enable_damage));
                                g_settings->set("name", playername);