From 1425c6def156840b359b90b4f32b9c7b8f005731 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Blot?= Date: Wed, 21 Jun 2017 11:51:29 +0200 Subject: Cpp11 initializers: last src root changeset (#6022) * Cpp11 initializers: last src root changeset Finish to migrate all src root folder files to C++11 constructor initializers --- src/shader.h | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'src/shader.h') diff --git a/src/shader.h b/src/shader.h index 4d31f705f..979318c95 100644 --- a/src/shader.h +++ b/src/shader.h @@ -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 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) -- cgit v1.2.3