summaryrefslogtreecommitdiff
path: root/modules/mono
diff options
context:
space:
mode:
Diffstat (limited to 'modules/mono')
-rw-r--r--modules/mono/csharp_script.cpp4
-rw-r--r--modules/mono/csharp_script.h2
-rw-r--r--modules/mono/glue/GodotSharp/GodotSharp/Core/Color.cs2
-rw-r--r--modules/mono/glue/GodotSharp/GodotSharp/Core/GD.cs31
-rw-r--r--modules/mono/glue/GodotSharp/GodotSharp/Core/Mathf.cs31
5 files changed, 38 insertions, 32 deletions
diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp
index 7606465b8a..ca94917938 100644
--- a/modules/mono/csharp_script.cpp
+++ b/modules/mono/csharp_script.cpp
@@ -2606,6 +2606,10 @@ Ref<Script> CSharpScript::get_base_script() const {
return base_script;
}
+StringName CSharpScript::get_global_name() const {
+ return StringName();
+}
+
void CSharpScript::get_script_property_list(List<PropertyInfo> *r_list) const {
#ifdef TOOLS_ENABLED
const CSharpScript *top = this;
diff --git a/modules/mono/csharp_script.h b/modules/mono/csharp_script.h
index ef381fd76a..6021555255 100644
--- a/modules/mono/csharp_script.h
+++ b/modules/mono/csharp_script.h
@@ -186,6 +186,8 @@ public:
bool inherits_script(const Ref<Script> &p_script) const override;
Ref<Script> get_base_script() const override;
+ StringName get_global_name() const override;
+
ScriptLanguage *get_language() const override;
void get_script_method_list(List<MethodInfo> *p_list) const override;
diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Color.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Color.cs
index 2effdecf40..6a7863112a 100644
--- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Color.cs
+++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Color.cs
@@ -797,7 +797,7 @@ namespace Godot
{
if (saturation == 0)
{
- // Achromatic (grey)
+ // Achromatic (gray)
return new Color(value, value, value, alpha);
}
diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/GD.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/GD.cs
index e4b79e7ec4..f3f124d5ad 100644
--- a/modules/mono/glue/GodotSharp/GodotSharp/Core/GD.cs
+++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/GD.cs
@@ -49,17 +49,6 @@ namespace Godot
return Variant.CreateTakingOwnershipOfDisposableValue(ret);
}
- /// <summary>
- /// Converts from decibels to linear energy (audio).
- /// </summary>
- /// <seealso cref="LinearToDb(real_t)"/>
- /// <param name="db">Decibels to convert.</param>
- /// <returns>Audio volume as linear energy.</returns>
- public static real_t DbToLinear(real_t db)
- {
- return (real_t)Math.Exp(db * 0.11512925464970228420089957273422);
- }
-
private static string[] GetPrintParams(object[] parameters)
{
if (parameters == null)
@@ -112,26 +101,6 @@ namespace Godot
}
/// <summary>
- /// Converts from linear energy to decibels (audio).
- /// This can be used to implement volume sliders that behave as expected (since volume isn't linear).
- /// </summary>
- /// <seealso cref="DbToLinear(real_t)"/>
- /// <example>
- /// <code>
- /// // "slider" refers to a node that inherits Range such as HSlider or VSlider.
- /// // Its range must be configured to go from 0 to 1.
- /// // Change the bus name if you'd like to change the volume of a specific bus only.
- /// AudioServer.SetBusVolumeDb(AudioServer.GetBusIndex("Master"), GD.LinearToDb(slider.value));
- /// </code>
- /// </example>
- /// <param name="linear">The linear energy to convert.</param>
- /// <returns>Audio as decibels.</returns>
- public static real_t LinearToDb(real_t linear)
- {
- return (real_t)(Math.Log(linear) * 8.6858896380650365530225783783321);
- }
-
- /// <summary>
/// Loads a resource from the filesystem located at <paramref name="path"/>.
/// The resource is loaded on the method call (unless it's referenced already
/// elsewhere, e.g. in another script or in the scene), which might cause slight delay,
diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Mathf.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Mathf.cs
index b2cb0f5e6b..137a42a6de 100644
--- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Mathf.cs
+++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Mathf.cs
@@ -324,6 +324,17 @@ namespace Godot
}
/// <summary>
+ /// Converts from decibels to linear energy (audio).
+ /// </summary>
+ /// <seealso cref="LinearToDb(real_t)"/>
+ /// <param name="db">Decibels to convert.</param>
+ /// <returns>Audio volume as linear energy.</returns>
+ public static real_t DbToLinear(real_t db)
+ {
+ return (real_t)Math.Exp(db * 0.11512925464970228420089957273422);
+ }
+
+ /// <summary>
/// Converts an angle expressed in degrees to radians.
/// </summary>
/// <param name="deg">An angle expressed in degrees.</param>
@@ -515,6 +526,26 @@ namespace Godot
}
/// <summary>
+ /// Converts from linear energy to decibels (audio).
+ /// This can be used to implement volume sliders that behave as expected (since volume isn't linear).
+ /// </summary>
+ /// <seealso cref="DbToLinear(real_t)"/>
+ /// <example>
+ /// <code>
+ /// // "slider" refers to a node that inherits Range such as HSlider or VSlider.
+ /// // Its range must be configured to go from 0 to 1.
+ /// // Change the bus name if you'd like to change the volume of a specific bus only.
+ /// AudioServer.SetBusVolumeDb(AudioServer.GetBusIndex("Master"), GD.LinearToDb(slider.value));
+ /// </code>
+ /// </example>
+ /// <param name="linear">The linear energy to convert.</param>
+ /// <returns>Audio as decibels.</returns>
+ public static real_t LinearToDb(real_t linear)
+ {
+ return (real_t)(Math.Log(linear) * 8.6858896380650365530225783783321);
+ }
+
+ /// <summary>
/// Natural logarithm. The amount of time needed to reach a certain level of continuous growth.
///
/// Note: This is not the same as the "log" function on most calculators, which uses a base 10 logarithm.