Browse Source

shader: Fix compiler warnings

rdb 2 years ago
parent
commit
2800996008
3 changed files with 9 additions and 9 deletions
  1. 3 3
      panda/src/gobj/shader.cxx
  2. 3 3
      panda/src/gobj/shader.h
  3. 3 3
      panda/src/gobj/shaderType.h

+ 3 - 3
panda/src/gobj/shader.cxx

@@ -50,9 +50,9 @@ static bool has_cg_header(const std::string &shader_text) {
  */
  */
 Shader::
 Shader::
 Shader(ShaderLanguage lang) :
 Shader(ShaderLanguage lang) :
+  _mat_deps(0),
   _error_flag(false),
   _error_flag(false),
   _language(lang),
   _language(lang),
-  _mat_deps(0),
   _cache_compiled_shader(false)
   _cache_compiled_shader(false)
 {
 {
 }
 }
@@ -2043,7 +2043,7 @@ bind_parameter(const Parameter &param) {
   }
   }
 
 
   // Other Cg-specific inputs.
   // Other Cg-specific inputs.
-  bool k_prefix = false;
+  //bool k_prefix = false;
   if (_language == SL_Cg) {
   if (_language == SL_Cg) {
     if (name_str.size() >= 2 && name_str.substr(0, 2) == "__") {
     if (name_str.size() >= 2 && name_str.substr(0, 2) == "__") {
       return true;
       return true;
@@ -2562,7 +2562,7 @@ bind_parameter(const Parameter &param) {
     // Previously, custom shader inputs needed the k_ prefix, so we have to
     // Previously, custom shader inputs needed the k_ prefix, so we have to
     // strip it now.
     // strip it now.
     if (pieces[0] == "k") {
     if (pieces[0] == "k") {
-      k_prefix = true;
+      //k_prefix = true;
       name_str = name_str.substr(2);
       name_str = name_str.substr(2);
       name = InternalName::make(name_str);
       name = InternalName::make(name_str);
     }
     }

+ 3 - 3
panda/src/gobj/shader.h

@@ -587,7 +587,7 @@ public:
 
 
 protected:
 protected:
   static TypedWritable *make_from_bam(const FactoryParams &params);
   static TypedWritable *make_from_bam(const FactoryParams &params);
-  void fillin(DatagramIterator &scan, BamReader *manager);
+  virtual void fillin(DatagramIterator &scan, BamReader *manager) override;
 
 
 public:
 public:
   static TypeHandle get_class_type() {
   static TypeHandle get_class_type() {
@@ -598,10 +598,10 @@ public:
     register_type(_type_handle, "Shader",
     register_type(_type_handle, "Shader",
                   TypedWritableReferenceCount::get_class_type());
                   TypedWritableReferenceCount::get_class_type());
   }
   }
-  virtual TypeHandle get_type() const {
+  virtual TypeHandle get_type() const override {
     return get_class_type();
     return get_class_type();
   }
   }
-  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
+  virtual TypeHandle force_init_type() override {init_type(); return get_class_type();}
 
 
 private:
 private:
   static TypeHandle _type_handle;
   static TypeHandle _type_handle;

+ 3 - 3
panda/src/gobj/shaderType.h

@@ -98,7 +98,7 @@ public:
   virtual const SampledImage *as_sampled_image() const { return nullptr; }
   virtual const SampledImage *as_sampled_image() const { return nullptr; }
 
 
   static void register_with_read_factory();
   static void register_with_read_factory();
-  virtual bool require_fully_complete() const;
+  virtual bool require_fully_complete() const override;
   static TypedWritable *change_this(TypedWritable *old_ptr, BamReader *manager);
   static TypedWritable *change_this(TypedWritable *old_ptr, BamReader *manager);
 
 
 public:
 public:
@@ -308,7 +308,7 @@ private:
 
 
 protected:
 protected:
   virtual void write_datagram(BamWriter *manager, Datagram &dg) override;
   virtual void write_datagram(BamWriter *manager, Datagram &dg) override;
-  virtual int complete_pointers(TypedWritable **plist, BamReader *manager);
+  virtual int complete_pointers(TypedWritable **plist, BamReader *manager) override;
   static TypedWritable *make_from_bam(const FactoryParams &params);
   static TypedWritable *make_from_bam(const FactoryParams &params);
 
 
 public:
 public:
@@ -364,7 +364,7 @@ private:
 
 
 protected:
 protected:
   virtual void write_datagram(BamWriter *manager, Datagram &dg) override;
   virtual void write_datagram(BamWriter *manager, Datagram &dg) override;
-  virtual int complete_pointers(TypedWritable **plist, BamReader *manager);
+  virtual int complete_pointers(TypedWritable **plist, BamReader *manager) override;
   static TypedWritable *make_from_bam(const FactoryParams &params);
   static TypedWritable *make_from_bam(const FactoryParams &params);
 
 
 public:
 public: