Browse Source

Add not-completely-useless output() method to ShaderAttrib

rdb 10 years ago
parent
commit
eca343c712
2 changed files with 23 additions and 0 deletions
  1. 22 0
      panda/src/pgraph/shaderAttrib.cxx
  2. 1 0
      panda/src/pgraph/shaderAttrib.h

+ 22 - 0
panda/src/pgraph/shaderAttrib.cxx

@@ -525,6 +525,28 @@ get_shader() const {
   return _shader;
 }
 
+////////////////////////////////////////////////////////////////////
+//     Function: ShaderAttrib::output
+//       Access: Public, Virtual
+//  Description:
+////////////////////////////////////////////////////////////////////
+void ShaderAttrib::
+output(ostream &out) const {
+  out << "ShaderAttrib:";
+
+  if (_has_shader) {
+    if (_shader == NULL) {
+      out << "off";
+    } else {
+      out << _shader->get_filename().get_basename();
+    }
+  } else if (_auto_shader) {
+    out << "auto";
+  }
+
+  out << "," << _inputs.size() << " inputs";
+}
+
 ////////////////////////////////////////////////////////////////////
 //     Function: ShaderAttrib::compare_to_impl
 //       Access: Protected, Virtual

+ 1 - 0
panda/src/pgraph/shaderAttrib.h

@@ -115,6 +115,7 @@ PUBLISHED:
   static void register_with_read_factory();
 
 public:
+  virtual void output(ostream &out) const;
 
 protected:
   virtual int compare_to_impl(const RenderAttrib *other) const;