]> git.lizzy.rs Git - minetest.git/blobdiff - src/shader.cpp
Change lower limit of display_gamma to 1.0 (linear light)
[minetest.git] / src / shader.cpp
index 0ac54ec0810aab3900c052046910bc474e8ff2d0..ea2de3f1e85e4bfe4010bd5af646341d668bdf36 100644 (file)
@@ -18,15 +18,15 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */
 
+#include <fstream>
+#include <iterator>
 #include "shader.h"
 #include "irrlichttypes_extrabloated.h"
 #include "debug.h"
-#include "main.h" // for g_settings
 #include "filesys.h"
 #include "util/container.h"
 #include "util/thread.h"
 #include "settings.h"
-#include <iterator>
 #include <ICameraSceneNode.h>
 #include <IGPUProgrammingServices.h>
 #include <IMaterialRenderer.h>
@@ -36,7 +36,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "log.h"
 #include "gamedef.h"
 #include "strfnd.h" // trim()
-#include "tile.h"
+#include "client/tile.h"
 
 /*
        A cache from shader name to shader path
@@ -196,7 +196,7 @@ class ShaderCallback : public video::IShaderConstantSetCallBack
        virtual void OnSetConstants(video::IMaterialRendererServices *services, s32 userData)
        {
                video::IVideoDriver *driver = services->getVideoDriver();
-               assert(driver);
+               sanity_check(driver != NULL);
 
                bool is_highlevel = userData;
 
@@ -219,7 +219,7 @@ class MainShaderConstantSetter : public IShaderConstantSetter
                        bool is_highlevel)
        {
                video::IVideoDriver *driver = services->getVideoDriver();
-               assert(driver);
+               sanity_check(driver);
 
                // set inverted world matrix
                core::matrix4 invWorld = driver->getTransform(video::ETS_WORLD);
@@ -364,7 +364,7 @@ void load_shaders(std::string name, SourceShaderCache *sourcecache,
 ShaderSource::ShaderSource(IrrlichtDevice *device):
                m_device(device)
 {
-       assert(m_device);
+       assert(m_device); // Pre-condition
 
        m_shader_callback = new ShaderCallback(this, "default");
 
@@ -505,7 +505,7 @@ void ShaderSource::insertSourceShader(const std::string &name_of_shader,
                        "name_of_shader=\""<<name_of_shader<<"\", "
                        "filename=\""<<filename<<"\""<<std::endl;*/
 
-       assert(get_current_thread_id() == m_main_thread);
+       sanity_check(get_current_thread_id() == m_main_thread);
 
        m_sourcecache.insert(name_of_shader, filename, program, true);
 }
@@ -578,7 +578,7 @@ ShaderInfo generate_shader(std::string name, u8 material_type, u8 drawtype,
                return shaderinfo;
 
        video::IVideoDriver* driver = device->getVideoDriver();
-       assert(driver);
+       sanity_check(driver);
 
        video::IGPUProgrammingServices *gpu = driver->getGPUProgrammingServices();
        if(!gpu){
@@ -644,7 +644,9 @@ ShaderInfo generate_shader(std::string name, u8 material_type, u8 drawtype,
                "NDT_FENCELIKE",
                "NDT_RAILLIKE",
                "NDT_NODEBOX",
-               "NDT_GLASSLIKE_FRAMED"
+               "NDT_GLASSLIKE_FRAMED",
+               "NDT_FIRELIKE",
+               "NDT_GLASSLIKE_FRAMED_OPTIONAL"
        };
        
        for (int i = 0; i < 14; i++){