You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-17 14:11:06 +00:00
C#: Code cleanup and greatly reduce use of C# pointers
This commit is contained in:
@@ -63,7 +63,7 @@ namespace GodotTools.Utils
|
||||
Internal.godot_icall_Utils_OS_GetPlatformName(out godot_string dest);
|
||||
using (dest)
|
||||
{
|
||||
string platformName = Marshaling.mono_string_from_godot(dest);
|
||||
string platformName = Marshaling.ConvertStringToManaged(dest);
|
||||
return name.Equals(platformName, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
}
|
||||
@@ -73,7 +73,7 @@ namespace GodotTools.Utils
|
||||
Internal.godot_icall_Utils_OS_GetPlatformName(out godot_string dest);
|
||||
using (dest)
|
||||
{
|
||||
string platformName = Marshaling.mono_string_from_godot(dest);
|
||||
string platformName = Marshaling.ConvertStringToManaged(dest);
|
||||
return names.Any(p => p.Equals(platformName, StringComparison.OrdinalIgnoreCase));
|
||||
}
|
||||
}
|
||||
@@ -185,7 +185,7 @@ namespace GodotTools.Utils
|
||||
return searchDirs.Select(dir => Path.Combine(dir, name))
|
||||
.FirstOrDefault(path =>
|
||||
{
|
||||
using godot_string pathIn = Marshaling.mono_string_to_godot(path);
|
||||
using godot_string pathIn = Marshaling.ConvertStringToNative(path);
|
||||
return File.Exists(path) && Internal.godot_icall_Utils_OS_UnixFileHasExecutableAccess(pathIn);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user