Modernize client code (#6250)
[oweals/minetest.git] / src / shader.h
index 4d31f705ff10b6da05f63e0dcdd715d1e55d30f6..1db4cba83ea08357933151dcff109c9495b8b70b 100644 (file)
@@ -22,7 +22,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define SHADER_HEADER
 
 #include <IMaterialRendererServices.h>
-#include "irrlichttypes_extrabloated.h"
+#include "irrlichttypes_bloated.h"
 #include <string>
 
 class IGameDef;
@@ -44,16 +44,13 @@ std::string getShaderPath(const std::string &name_of_shader,
                const std::string &filename);
 
 struct ShaderInfo {
-       std::string name;
-       video::E_MATERIAL_TYPE base_material;
-       video::E_MATERIAL_TYPE material;
-       u8 drawtype;
-       u8 material_type;
-       s32 user_data;
-
-       ShaderInfo(): name(""), base_material(video::EMT_SOLID),
-               material(video::EMT_SOLID),
-               drawtype(0), material_type(0) {}
+       std::string name = "";
+       video::E_MATERIAL_TYPE base_material = video::EMT_SOLID;
+       video::E_MATERIAL_TYPE material = video::EMT_SOLID;
+       u8 drawtype = 0;
+       u8 material_type = 0;
+
+       ShaderInfo() {}
        virtual ~ShaderInfo() {}
 };
 
@@ -85,11 +82,11 @@ template <typename T, std::size_t count=1>
 class CachedShaderSetting {
        const char *m_name;
        T m_sent[count];
-       bool has_been_set;
+       bool has_been_set = false;
        bool is_pixel;
 protected:
        CachedShaderSetting(const char *name, bool is_pixel) :
-               m_name(name), has_been_set(false), is_pixel(is_pixel)
+               m_name(name), is_pixel(is_pixel)
        {}
 public:
        void set(const T value[count], video::IMaterialRendererServices *services)
@@ -152,7 +149,7 @@ public:
        virtual void addShaderConstantSetterFactory(IShaderConstantSetterFactory *setter) = 0;
 };
 
-IWritableShaderSource* createShaderSource(IrrlichtDevice *device);
+IWritableShaderSource *createShaderSource();
 
 void dumpShaderProgram(std::ostream &output_stream,
        const std::string &program_type, const std::string &program);