ソースを参照

Shader: Remove unused parse_* member functions

Mitchell Stokes 6 年 前
コミット
149da2f823
2 ファイル変更0 行追加84 行削除
  1. 0 75
      panda/src/gobj/shader.cxx
  2. 0 9
      panda/src/gobj/shader.h

+ 0 - 75
panda/src/gobj/shader.cxx

@@ -3435,81 +3435,6 @@ make_compute(ShaderLanguage lang, string body) {
   return shader;
 }
 
-/**
- * Set a 'parse pointer' to the beginning of the shader.
- */
-void Shader::
-parse_init() {
-  _parse = 0;
-}
-
-/**
- * Parse a line of text.  If 'lt' is true, trim blanks from the left end of
- * the line.  If 'rt' is true, trim blanks from the right end (the newline is
- * always trimmed).
- */
-void Shader::
-parse_line(string &result, bool lt, bool rt) {
-  nassertv(!_text._separate);
-  int len = _text._shared.size();
-  int head = _parse;
-  int tail = head;
-  while ((tail < len) && (_text._shared[tail] != '\n')) {
-    tail++;
-  }
-  if (tail < len) {
-    _parse = tail+1;
-  } else {
-    _parse = tail;
-  }
-  if (lt) {
-    while ((head < tail)&&(isspace(_text._shared[head]))) head++;
-    while ((tail > head)&&(isspace(_text._shared[tail-1]))) tail--;
-  }
-  result = _text._shared.substr(head, tail-head);
-}
-
-/**
- * Parse lines until you read a line that matches the specified pattern.
- * Returns all the preceding lines, and if the include flag is set, returns
- * the final line as well.
- */
-void Shader::
-parse_upto(string &result, string pattern, bool include) {
-  nassertv(!_text._separate);
-  GlobPattern endpat(pattern);
-  int start = _parse;
-  int last = _parse;
-  while (_parse < (int)(_text._shared.size())) {
-    string t;
-    parse_line(t, true, true);
-    if (endpat.matches(t)) break;
-    last = _parse;
-  }
-  if (include) {
-    result = _text._shared.substr(start, _parse - start);
-  } else {
-    result = _text._shared.substr(start, last - start);
-  }
-}
-
-/**
- * Returns the rest of the text from the current parse location.
- */
-void Shader::
-parse_rest(string &result) {
-  nassertv(!_text._separate);
-  result = _text._shared.substr(_parse, _text._shared.size() - _parse);
-}
-
-/**
- * Returns true if the parse pointer is at the end of the shader.
- */
-bool Shader::
-parse_eof() {
-  return (int)_text._shared.size() == _parse;
-}
-
 /**
  * Indicates that the shader should be enqueued to be prepared in the
  * indicated prepared_objects at the beginning of the next frame.  This will

+ 0 - 9
panda/src/gobj/shader.h

@@ -492,15 +492,6 @@ public:
   };
 
 public:
-  // These routines help split the shader into sections, for those shader
-  // implementations that need to do so.  Don't use them when you use separate
-  // shader programs.
-  void parse_init();
-  void parse_line(std::string &result, bool rt, bool lt);
-  void parse_upto(std::string &result, std::string pattern, bool include);
-  void parse_rest(std::string &result);
-  bool parse_eof();
-
   void cp_report_error(ShaderArgInfo &arg, const std::string &msg);
   bool cp_errchk_parameter_words(ShaderArgInfo &arg, int len);
   bool cp_errchk_parameter_in(ShaderArgInfo &arg);