feat: modules moved and engine moved to submodule

This commit is contained in:
Jan van der Weide 2025-04-12 18:40:44 +02:00
parent dfb5e645cd
commit c33d2130cc
5136 changed files with 225275 additions and 64485 deletions

View file

@ -133,7 +133,7 @@ void ShaderPreprocessor::Tokenizer::skip_whitespace() {
bool ShaderPreprocessor::Tokenizer::consume_empty_line() {
// Read until newline and return true if the content was all whitespace/empty.
return tokens_to_string(advance('\n')).strip_edges().size() == 0;
return tokens_to_string(advance('\n')).strip_edges().is_empty();
}
String ShaderPreprocessor::Tokenizer::get_identifier(bool *r_is_cursor, bool p_started) {
@ -1096,7 +1096,7 @@ bool ShaderPreprocessor::expand_macros_once(const String &p_line, int p_line_num
int arg_index_start = 0;
int arg_index = 0;
while (find_match(body, arg_name, arg_index, arg_index_start)) {
body = body.substr(0, arg_index) + args[i] + body.substr(arg_index + arg_name.length(), body.length() - (arg_index + arg_name.length()));
body = body.substr(0, arg_index) + args[i] + body.substr(arg_index + arg_name.length());
// Manually reset arg_index_start to where the arg value of the define finishes.
// This ensures we don't skip the other args of this macro in the string.
arg_index_start = arg_index + args[i].length() + 1;
@ -1105,11 +1105,11 @@ bool ShaderPreprocessor::expand_macros_once(const String &p_line, int p_line_num
concatenate_macro_body(body);
result = result.substr(0, index) + " " + body + " " + result.substr(args_end + 1, result.length());
result = result.substr(0, index) + " " + body + " " + result.substr(args_end + 1);
} else {
concatenate_macro_body(body);
result = result.substr(0, index) + " " + body + " " + result.substr(index + key.length(), result.length() - (index + key.length()));
result = result.substr(0, index) + " " + body + " " + result.substr(index + key.length());
}
r_expanded = result;
@ -1176,7 +1176,7 @@ void ShaderPreprocessor::concatenate_macro_body(String &r_body) {
index_start--;
}
r_body = r_body.substr(0, index_start) + r_body.substr(index_end, r_body.length() - index_end);
r_body = r_body.substr(0, index_start) + r_body.substr(index_end);
index_start = r_body.find("##", index_start);
}