diff options
author | SignpostMarv | 2012-07-27 10:49:47 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-07-28 00:09:11 +0100 |
commit | 72d29bdb40c16ba4785b16e4025bf810baa96cb5 (patch) | |
tree | e68e7163cb1ef623d961f397560b6f9e5db3be3f /OpenSim/Region/ScriptEngine | |
parent | Avoid a race condition between the scene shutdown thread and the update threa... (diff) | |
download | opensim-SC_OLD-72d29bdb40c16ba4785b16e4025bf810baa96cb5.zip opensim-SC_OLD-72d29bdb40c16ba4785b16e4025bf810baa96cb5.tar.gz opensim-SC_OLD-72d29bdb40c16ba4785b16e4025bf810baa96cb5.tar.bz2 opensim-SC_OLD-72d29bdb40c16ba4785b16e4025bf810baa96cb5.tar.xz |
LSL/OSSL lacks Math.Min & Math.Max implementations.
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
3 files changed, 54 insertions, 0 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index faad75d..44de176 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -3286,5 +3286,33 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3286 | UUID test; | 3286 | UUID test; |
3287 | return UUID.TryParse(thing, out test) ? 1 : 0; | 3287 | return UUID.TryParse(thing, out test) ? 1 : 0; |
3288 | } | 3288 | } |
3289 | |||
3290 | /// <summary> | ||
3291 | /// Wraps to Math.Min() | ||
3292 | /// </summary> | ||
3293 | /// <param name="a"></param> | ||
3294 | /// <param name="b"></param> | ||
3295 | /// <returns></returns> | ||
3296 | public LSL_Float osMin(double a, double b) | ||
3297 | { | ||
3298 | CheckThreatLevel(ThreatLevel.None, "osMin"); | ||
3299 | m_host.AddScriptLPS(1); | ||
3300 | |||
3301 | return Math.Min(a, b); | ||
3302 | } | ||
3303 | |||
3304 | /// <summary> | ||
3305 | /// Wraps to Math.max() | ||
3306 | /// </summary> | ||
3307 | /// <param name="a"></param> | ||
3308 | /// <param name="b"></param> | ||
3309 | /// <returns></returns> | ||
3310 | public LSL_Float osMax(double a, double b) | ||
3311 | { | ||
3312 | CheckThreatLevel(ThreatLevel.None, "osMax"); | ||
3313 | m_host.AddScriptLPS(1); | ||
3314 | |||
3315 | return Math.Max(a, b); | ||
3316 | } | ||
3289 | } | 3317 | } |
3290 | } \ No newline at end of file | 3318 | } \ No newline at end of file |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index c9403eb..f73a85e 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | |||
@@ -283,5 +283,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces | |||
283 | /// <param name="thing"></param> | 283 | /// <param name="thing"></param> |
284 | /// <returns>1 if thing is a valid UUID, 0 otherwise</returns> | 284 | /// <returns>1 if thing is a valid UUID, 0 otherwise</returns> |
285 | LSL_Integer osIsUUID(string thing); | 285 | LSL_Integer osIsUUID(string thing); |
286 | |||
287 | /// <summary> | ||
288 | /// Wraps to Math.Min() | ||
289 | /// </summary> | ||
290 | /// <param name="a"></param> | ||
291 | /// <param name="b"></param> | ||
292 | /// <returns></returns> | ||
293 | LSL_Float osMin(double a, double b); | ||
294 | |||
295 | /// <summary> | ||
296 | /// Wraps to Math.max() | ||
297 | /// </summary> | ||
298 | /// <param name="a"></param> | ||
299 | /// <param name="b"></param> | ||
300 | /// <returns></returns> | ||
301 | LSL_Float osMax(double a, double b); | ||
286 | } | 302 | } |
287 | } | 303 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index 99995a7..53daa13 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | |||
@@ -935,5 +935,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
935 | { | 935 | { |
936 | return m_OSSL_Functions.osIsUUID(thing); | 936 | return m_OSSL_Functions.osIsUUID(thing); |
937 | } | 937 | } |
938 | |||
939 | public LSL_Float osMin(double a, double b) | ||
940 | { | ||
941 | return m_OSSL_Functions.osMin(a, b); | ||
942 | } | ||
943 | |||
944 | public LSL_Float osMax(double a, double b) | ||
945 | { | ||
946 | return m_OSSL_Functions.osMax(a, b); | ||
947 | } | ||
938 | } | 948 | } |
939 | } | 949 | } |