mirror of
https://github.com/Almamu/linux-wallpaperengine.git
synced 2025-09-14 13:56:48 +08:00
fix: ensure variable information is not commented out by a line comment
This commit is contained in:
parent
499c7490eb
commit
0902e7cfd5
@ -106,7 +106,13 @@ void CShaderUnit::preprocessVariables () {
|
|||||||
|
|
||||||
if (combo != std::string::npos) {
|
if (combo != std::string::npos) {
|
||||||
this->parseComboConfiguration (line.substr(combo + strlen("// [COMBO] ")), 0);
|
this->parseComboConfiguration (line.substr(combo + strlen("// [COMBO] ")), 0);
|
||||||
} else if (uniform != std::string::npos && comment != std::string::npos && semicolon != std::string::npos) {
|
} else if (
|
||||||
|
uniform != std::string::npos &&
|
||||||
|
comment != std::string::npos &&
|
||||||
|
semicolon != std::string::npos &&
|
||||||
|
// this check ensures that the comment is after the semicolon (so it's not a commented-out line)
|
||||||
|
// this needs further refining as it's not taking into account block comments
|
||||||
|
semicolon < comment) {
|
||||||
// uniforms with comments should never have a value assigned, use this fact to detect the required parts
|
// uniforms with comments should never have a value assigned, use this fact to detect the required parts
|
||||||
size_t last_space = line.find_last_of (' ', semicolon);
|
size_t last_space = line.find_last_of (' ', semicolon);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user