Merge branch 'MihailRis:main' into main
This commit is contained in:
@@ -82,8 +82,8 @@ inline void parsing_warning(
|
|||||||
" at line "+std::to_string(linenum) << std::endl;
|
" at line "+std::to_string(linenum) << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void source_line(std::stringstream& ss, const path& file, uint linenum) {
|
inline void source_line(std::stringstream& ss, uint linenum) {
|
||||||
ss << "#line " << linenum << " " << file << '\n';
|
ss << "#line " << linenum << "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
const string GLSLExtension::process(const path file, const string& source) {
|
const string GLSLExtension::process(const path file, const string& source) {
|
||||||
@@ -94,7 +94,7 @@ const string GLSLExtension::process(const path file, const string& source) {
|
|||||||
for (auto& entry : defines) {
|
for (auto& entry : defines) {
|
||||||
ss << "#define " << entry.first << " " << entry.second << '\n';
|
ss << "#define " << entry.first << " " << entry.second << '\n';
|
||||||
}
|
}
|
||||||
source_line(ss, file, linenum);
|
source_line(ss, linenum);
|
||||||
while (pos < source.length()) {
|
while (pos < source.length()) {
|
||||||
size_t endline = source.find('\n', pos);
|
size_t endline = source.find('\n', pos);
|
||||||
if (endline == string::npos) {
|
if (endline == string::npos) {
|
||||||
@@ -121,11 +121,11 @@ const string GLSLExtension::process(const path file, const string& source) {
|
|||||||
if (!hasHeader(name)) {
|
if (!hasHeader(name)) {
|
||||||
loadHeader(name);
|
loadHeader(name);
|
||||||
}
|
}
|
||||||
source_line(ss, hfile, 1);
|
source_line(ss, 1);
|
||||||
ss << getHeader(name) << '\n';
|
ss << getHeader(name) << '\n';
|
||||||
pos = endline+1;
|
pos = endline+1;
|
||||||
linenum++;
|
linenum++;
|
||||||
source_line(ss, file, linenum);
|
source_line(ss, linenum);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// removing extra 'include' directives
|
// removing extra 'include' directives
|
||||||
@@ -133,7 +133,7 @@ const string GLSLExtension::process(const path file, const string& source) {
|
|||||||
parsing_warning(file, linenum, "removed #version directive");
|
parsing_warning(file, linenum, "removed #version directive");
|
||||||
pos = endline+1;
|
pos = endline+1;
|
||||||
linenum++;
|
linenum++;
|
||||||
source_line(ss, file, linenum);
|
source_line(ss, linenum);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user