diff options
author | Romain Guy <romainguy@android.com> | 2009-08-09 17:04:54 -0700 |
---|---|---|
committer | Romain Guy <romainguy@android.com> | 2009-08-09 19:12:27 -0700 |
commit | a9d2d5ed2840bc3331e1a387b26efc44c6211623 (patch) | |
tree | 6cb4de9b8addfdf1762f40296ebdb8995cf1ebf6 /libs/rs/rsScriptC_Lib.cpp | |
parent | 3370ec9e54c373ccca3c4f545b4c96f9419a081d (diff) |
Make the laves follow the ripples
Diffstat (limited to 'libs/rs/rsScriptC_Lib.cpp')
-rw-r--r-- | libs/rs/rsScriptC_Lib.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libs/rs/rsScriptC_Lib.cpp b/libs/rs/rsScriptC_Lib.cpp index 1ef6b4efc2d3..b46e1cfd5863 100644 --- a/libs/rs/rsScriptC_Lib.cpp +++ b/libs/rs/rsScriptC_Lib.cpp @@ -188,6 +188,11 @@ static float SC_clampf(float amount, float low, float high) return amount < low ? low : (amount > high ? high : amount); } +static int SC_clamp(int amount, int low, int high) +{ + return amount < low ? low : (amount > high ? high : amount); +} + static float SC_maxf(float a, float b) { return a > b ? a : b; @@ -826,6 +831,8 @@ ScriptCState::SymbolTable_t ScriptCState::gSyms[] = { "void", "(int)" }, // math + { "modf", (void *)&fmod, + "float", "(float, float)" }, { "abs", (void *)&abs, "int", "(int)" }, { "absf", (void *)&fabs, @@ -870,6 +877,8 @@ ScriptCState::SymbolTable_t ScriptCState::gSyms[] = { "int", "(int)" }, { "sqrf", (void *)&SC_sqrf, "float", "(float)" }, + { "clamp", (void *)&SC_clamp, + "int", "(int, int, int)" }, { "clampf", (void *)&SC_clampf, "float", "(float, float, float)" }, { "distf2", (void *)&SC_distf2, |