Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenoit Bolsee <benoit.bolsee@online.be>2009-03-12 01:11:52 +0300
committerBenoit Bolsee <benoit.bolsee@online.be>2009-03-12 01:11:52 +0300
commita37cec2802d96306426f41c64f6ed69ab3680355 (patch)
treed0ad9ba1a8fb64072a6427e82b0fc4aa2a153d83 /source/gameengine/Expressions/FloatValue.cpp
parent0ac3e7016048a7e66285b3539c6e86cf83a4cb06 (diff)
BGE patch 18368: Modulus (ie %) expression controller in BGE. Implement a cache for the expression for better performance.
Diffstat (limited to 'source/gameengine/Expressions/FloatValue.cpp')
-rw-r--r--source/gameengine/Expressions/FloatValue.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/gameengine/Expressions/FloatValue.cpp b/source/gameengine/Expressions/FloatValue.cpp
index 93f102d04a6..460eaa73f35 100644
--- a/source/gameengine/Expressions/FloatValue.cpp
+++ b/source/gameengine/Expressions/FloatValue.cpp
@@ -127,6 +127,9 @@ ret: a new object containing the result of applying operator op to val and
{
switch (op)
{
+ case VALUE_MOD_OPERATOR:
+ ret = new CFloatValue(fmod(((CIntValue *) val)->GetInt(), m_float));
+ break;
case VALUE_ADD_OPERATOR:
ret = new CFloatValue(((CIntValue *) val)->GetInt() + m_float);
break;
@@ -171,6 +174,9 @@ ret: a new object containing the result of applying operator op to val and
{
switch (op)
{
+ case VALUE_MOD_OPERATOR:
+ ret = new CFloatValue(fmod(((CFloatValue *) val)->GetFloat(), m_float));
+ break;
case VALUE_ADD_OPERATOR:
ret = new CFloatValue(((CFloatValue *) val)->GetFloat() + m_float);
break;