Skip to content

Commit

Permalink
Merge pull request #873 from Spartan322/merge/fd4c29a
Browse files Browse the repository at this point in the history
  • Loading branch information
Spartan322 authored Nov 19, 2024
2 parents 9767837 + cfc378b commit fd9045f
Show file tree
Hide file tree
Showing 131 changed files with 1,351 additions and 787 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ compile_commands.json
platform/windows/godot_res.res

# Ninja build files
build.ninja
.ninja
*.ninja
.ninja/
run_ninja_env.bat

# Generated by Godot binary
Expand Down
4 changes: 2 additions & 2 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -1050,7 +1050,7 @@ if env["ninja"]:
SetOption("experimental", "ninja")
env["NINJA_FILE_NAME"] = env["ninja_file"]
env["NINJA_DISABLE_AUTO_RUN"] = not env["ninja_auto_run"]
env.Tool("ninja", "build.ninja")
env.Tool("ninja", env["ninja_file"])

# Threads
if env["threads"]:
Expand Down Expand Up @@ -1112,7 +1112,7 @@ atexit.register(print_elapsed_time)


def purge_flaky_files():
paths_to_keep = ["build.ninja"]
paths_to_keep = [env["ninja_file"]]
for build_failure in GetBuildFailures():
path = build_failure.node.path
if os.path.isfile(path) and path not in paths_to_keep:
Expand Down
14 changes: 10 additions & 4 deletions core/config/project_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ String ProjectSettings::localize_path(const String &p_path) const {

return cwd.replace_first(res_path, "res://");
} else {
int sep = path.rfind("/");
int sep = path.rfind_char('/');
if (sep == -1) {
return "res://" + path;
}
Expand Down Expand Up @@ -264,6 +264,12 @@ String ProjectSettings::globalize_path(const String &p_path) const {
return p_path.replace("res:/", resource_path);
}
return p_path.replace("res://", "");
} else if (p_path.begins_with("uid://")) {
const String path = ResourceUID::uid_to_path(p_path);
if (!resource_path.is_empty()) {
return path.replace("res:/", resource_path);
}
return path.replace("res://", "");
} else if (p_path.begins_with("user://")) {
String data_dir = OS::get_singleton()->get_user_data_dir();
if (!data_dir.is_empty()) {
Expand Down Expand Up @@ -302,7 +308,7 @@ bool ProjectSettings::_set(const StringName &p_name, const Variant &p_value) {
}

{ // Feature overrides.
int dot = p_name.operator String().find(".");
int dot = p_name.operator String().find_char('.');
if (dot != -1) {
Vector<String> s = p_name.operator String().split(".");

Expand Down Expand Up @@ -437,7 +443,7 @@ void ProjectSettings::_get_property_list(List<PropertyInfo> *p_list) const {

for (const _VCSort &E : vclist) {
String prop_info_name = E.name;
int dot = prop_info_name.find(".");
int dot = prop_info_name.find_char('.');
if (dot != -1 && !custom_prop_info.has(prop_info_name)) {
prop_info_name = prop_info_name.substr(0, dot);
}
Expand Down Expand Up @@ -1094,7 +1100,7 @@ Error ProjectSettings::save_custom(const String &p_path, const CustomMap &p_cust
String category = E.name;
String name = E.name;

int div = category.find("/");
int div = category.find_char('/');

if (div < 0) {
category = "";
Expand Down
2 changes: 1 addition & 1 deletion core/debugger/engine_debugger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ void EngineDebugger::initialize(const String &p_uri, bool p_skip_breakpoints, co

for (int i = 0; i < p_breakpoints.size(); i++) {
const String &bp = p_breakpoints[i];
int sp = bp.rfind(":");
int sp = bp.rfind_char(':');
ERR_CONTINUE_MSG(sp == -1, vformat("Invalid breakpoint: '%s', expected file:line format.", bp));

singleton_script_debugger->insert_breakpoint(bp.substr(sp + 1, bp.length()).to_int(), bp.substr(0, sp));
Expand Down
4 changes: 2 additions & 2 deletions core/debugger/local_debugger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ void LocalDebugger::debug(bool p_can_continue, bool p_is_error_breakpoint) {

} else {
String key_value = line.get_slicec(' ', 1);
int value_pos = key_value.find("=");
int value_pos = key_value.find_char('=');

if (value_pos < 0) {
print_line("Error: Invalid set format. Use: set key=value");
Expand Down Expand Up @@ -346,7 +346,7 @@ Pair<String, int> LocalDebugger::to_breakpoint(const String &p_line) {
String breakpoint_part = p_line.get_slicec(' ', 1);
Pair<String, int> breakpoint;

int last_colon = breakpoint_part.rfind(":");
int last_colon = breakpoint_part.rfind_char(':');
if (last_colon < 0) {
print_line("Error: Invalid breakpoint format. Expected [source:line]");
return breakpoint;
Expand Down
4 changes: 2 additions & 2 deletions core/debugger/remote_debugger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ void RemoteDebugger::_send_stack_vars(List<String> &p_names, List<Variant> &p_va
}

Error RemoteDebugger::_try_capture(const String &p_msg, const Array &p_data, bool &r_captured) {
const int idx = p_msg.find(":");
const int idx = p_msg.find_char(':');
r_captured = false;
if (idx < 0) { // No prefix, unknown message.
return OK;
Expand Down Expand Up @@ -612,7 +612,7 @@ void RemoteDebugger::poll_events(bool p_is_idle) {
ERR_CONTINUE(arr[1].get_type() != Variant::ARRAY);

const String cmd = arr[0];
const int idx = cmd.find(":");
const int idx = cmd.find_char(':');
bool parsed = false;
if (idx < 0) { // Not prefix, use scripts capture.
capture_parse("core", cmd, arr[1], parsed);
Expand Down
2 changes: 1 addition & 1 deletion core/debugger/remote_debugger_peer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ RemoteDebuggerPeer *RemoteDebuggerPeerTCP::create(const String &p_uri) {
uint16_t debug_port = 6007;

if (debug_host.contains(":")) {
int sep_pos = debug_host.rfind(":");
int sep_pos = debug_host.rfind_char(':');
debug_port = debug_host.substr(sep_pos + 1).to_int();
debug_host = debug_host.substr(0, sep_pos);
}
Expand Down
Loading

0 comments on commit fd9045f

Please sign in to comment.