Settings: everything != 0 equals true; remove .asm shaders
authorPilzAdam <pilzadam@minetest.net>
Sun, 7 Jul 2013 23:58:22 +0000 (01:58 +0200)
committerPilzAdam <pilzadam@minetest.net>
Sun, 7 Jul 2013 23:58:49 +0000 (01:58 +0200)
src/shader.cpp
src/test.cpp
src/util/string.h

index 19b8d7c9d9b2306d6305c56c96156167705a7752..ed8cc5b739f23d0726cce7b4fc400d02a176143e 100644 (file)
@@ -624,7 +624,6 @@ ShaderInfo generate_shader(std::string name, IrrlichtDevice *device,
                }
        }
 
-       // 0 = off, 1 = assembly shaders only, 2 = highlevel or assembly
        bool enable_shaders = g_settings->getBool("enable_shaders");
        if(!enable_shaders)
                return shaderinfo;
@@ -778,24 +777,4 @@ void load_shaders(std::string name, SourceShaderCache *sourcecache,
                }
        }
 
-       if(enable_shaders){
-               // Look for assembly shaders
-               if(drivertype == video::EDT_DIRECT3D8){
-                       // Direct3D 8 assembly shaders
-                       vertex_program = sourcecache->getOrLoad(name, "d3d8_vertex.asm");
-                       pixel_program = sourcecache->getOrLoad(name, "d3d8_pixel.asm");
-               }
-               else if(drivertype == video::EDT_DIRECT3D9){
-                       // Direct3D 9 assembly shaders
-                       vertex_program = sourcecache->getOrLoad(name, "d3d9_vertex.asm");
-                       pixel_program = sourcecache->getOrLoad(name, "d3d9_pixel.asm");
-               }
-               else if(drivertype == video::EDT_OPENGL){
-                       // OpenGL assembly shaders
-                       vertex_program = sourcecache->getOrLoad(name, "opengl_vertex.asm");
-                       pixel_program = sourcecache->getOrLoad(name, "opengl_fragment.asm");
-               }
-               if(vertex_program != "" || pixel_program != "")
-                       return;
-       }
 }
index e609fe26f6c7e6ef705c8623ccc1ea44cc8aa3b4..ddbcee7f2815c800f71bd18d5a7fd5feca3b0a5a 100644 (file)
@@ -164,6 +164,10 @@ struct TestUtilities: public TestBase
                UASSERT(is_yes("YeS") == true);
                UASSERT(is_yes("") == false);
                UASSERT(is_yes("FAlse") == false);
+               UASSERT(is_yes("-1") == true);
+               UASSERT(is_yes("0") == false);
+               UASSERT(is_yes("1") == true);
+               UASSERT(is_yes("2") == true);
                const char *ends[] = {"abc", "c", "bc", NULL};
                UASSERT(removeStringEnd("abc", ends) == "");
                UASSERT(removeStringEnd("bc", ends) == "b");
index 6c48adeb3d70b0368f4f62b5a7a13d4ebcd03081..d8cedc3e8ed7c938cc012717075b0a636ceb8dc2 100644 (file)
@@ -146,7 +146,7 @@ inline std::string lowercase(const std::string &s)
 inline bool is_yes(const std::string &s)
 {
        std::string s2 = lowercase(trim(s));
-       if(s2 == "y" || s2 == "yes" || s2 == "true" || s2 == "1")
+       if(s2 == "y" || s2 == "yes" || s2 == "true" || atoi(s2.c_str()) != 0)
                return true;
        return false;
 }