]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/sourcemap.cpp
Fix opcode for matrix inverse
[libs/gl.git] / source / glsl / sourcemap.cpp
index e74f1b67408367ab2ff2a3a28c6381b6aa54656e..9eb33b05733a9ce3c0659cad2272aedcd37b2d1e 100644 (file)
@@ -13,7 +13,7 @@ SourceMap::SourceMap():
        base_index(0)
 { }
 
-void SourceMap::set_name(unsigned i, const std::string &n)
+void SourceMap::set_name(unsigned i, const string &n)
 {
        if(source_names.empty())
                base_index = i;
@@ -29,6 +29,16 @@ void SourceMap::set_name(unsigned i, const std::string &n)
        source_names[i] = n;
 }
 
+const string &SourceMap::get_name(unsigned i) const
+{
+       i -= base_index;
+       if(i<source_names.size())
+               return source_names[i];
+
+       static string empty;
+       return empty;
+}
+
 void SourceMap::merge_from(const SourceMap &other)
 {
        if(other.base_index<base_index)