LuaVoxelManip: Add option to allocate blank data
[oweals/minetest.git] / src / shader.cpp
index f855a7fe3cd07eabc8585cf8a1ddc55655f5b7c9..1670458040f07da0052fa9e5fa7d6f544319a7f7 100644 (file)
@@ -211,8 +211,7 @@ public:
 class MainShaderConstantSetter : public IShaderConstantSetter
 {
 public:
-       MainShaderConstantSetter(IrrlichtDevice *device):
-               m_device(device)
+       MainShaderConstantSetter(IrrlichtDevice *device)
        {}
        ~MainShaderConstantSetter() {}
 
@@ -256,9 +255,6 @@ public:
                        services->setVertexShaderConstant(world.pointer(), 8, 4);
 
        }
-
-private:
-       IrrlichtDevice *m_device;
 };
 
 /*
@@ -383,13 +379,16 @@ ShaderSource::ShaderSource(IrrlichtDevice *device):
 
 ShaderSource::~ShaderSource()
 {
-       //m_shader_callback->drop();
-
        for (std::vector<IShaderConstantSetter*>::iterator iter = m_global_setters.begin();
                        iter != m_global_setters.end(); iter++) {
                delete *iter;
        }
        m_global_setters.clear();
+
+       if (m_shader_callback) {
+               m_shader_callback->drop();
+               m_shader_callback = NULL;
+       }
 }
 
 u32 ShaderSource::getShader(const std::string &name, 
@@ -645,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++){