diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-11-06 16:27:56 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-06 16:27:56 +0100 |
commit | 391d29f558d122798416b5957660d9eeceecd0f5 (patch) | |
tree | 4124faa0c5cf14841d23fb77fff406380dbe6a76 /modules/mono/glue/gd_glue.cpp | |
parent | 6797ab67193d0c016952a1138e49a589ae40724a (diff) | |
parent | 38fb26794bcc4352c22e46b97408673cf7084c57 (diff) |
Merge pull request #40718 from Chaosus/rand_range
Exposed randi_range to global funcs + renamed rand_range to randf_range
Diffstat (limited to 'modules/mono/glue/gd_glue.cpp')
-rw-r--r-- | modules/mono/glue/gd_glue.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/modules/mono/glue/gd_glue.cpp b/modules/mono/glue/gd_glue.cpp index 5e892b616b..133692a88c 100644 --- a/modules/mono/glue/gd_glue.cpp +++ b/modules/mono/glue/gd_glue.cpp @@ -193,7 +193,11 @@ void godot_icall_GD_randomize() { Math::randomize(); } -double godot_icall_GD_rand_range(double from, double to) { +double godot_icall_GD_randf_range(double from, double to) { + return Math::random(from, to); +} + +int32_t godot_icall_GD_randi_range(int32_t from, int32_t to) { return Math::random(from, to); } @@ -298,7 +302,8 @@ void godot_register_gd_icalls() { mono_add_internal_call("Godot.GD::godot_icall_GD_randf", (void *)godot_icall_GD_randf); mono_add_internal_call("Godot.GD::godot_icall_GD_randi", (void *)godot_icall_GD_randi); mono_add_internal_call("Godot.GD::godot_icall_GD_randomize", (void *)godot_icall_GD_randomize); - mono_add_internal_call("Godot.GD::godot_icall_GD_rand_range", (void *)godot_icall_GD_rand_range); + mono_add_internal_call("Godot.GD::godot_icall_GD_randf_range", (void *)godot_icall_GD_randf_range); + mono_add_internal_call("Godot.GD::godot_icall_GD_randi_range", (void *)godot_icall_GD_randi_range); mono_add_internal_call("Godot.GD::godot_icall_GD_rand_seed", (void *)godot_icall_GD_rand_seed); mono_add_internal_call("Godot.GD::godot_icall_GD_seed", (void *)godot_icall_GD_seed); mono_add_internal_call("Godot.GD::godot_icall_GD_str", (void *)godot_icall_GD_str); |