diff options
author | Benoit Bolsee <benoit.bolsee@online.be> | 2009-03-12 01:11:52 +0300 |
---|---|---|
committer | Benoit Bolsee <benoit.bolsee@online.be> | 2009-03-12 01:11:52 +0300 |
commit | a37cec2802d96306426f41c64f6ed69ab3680355 (patch) | |
tree | d0ad9ba1a8fb64072a6427e82b0fc4aa2a153d83 /source/gameengine/Expressions/IntValue.cpp | |
parent | 0ac3e7016048a7e66285b3539c6e86cf83a4cb06 (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/IntValue.cpp')
-rw-r--r-- | source/gameengine/Expressions/IntValue.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/gameengine/Expressions/IntValue.cpp b/source/gameengine/Expressions/IntValue.cpp index fbf4f4f59e0..fb586cb4979 100644 --- a/source/gameengine/Expressions/IntValue.cpp +++ b/source/gameengine/Expressions/IntValue.cpp @@ -125,6 +125,9 @@ this object case VALUE_INT_TYPE: { switch (op) { + case VALUE_MOD_OPERATOR: + ret = new CIntValue (((CIntValue *) val)->GetInt() % m_int); + break; case VALUE_ADD_OPERATOR: ret = new CIntValue (((CIntValue *) val)->GetInt() + m_int); break; @@ -181,6 +184,9 @@ this object case VALUE_FLOAT_TYPE: { switch (op) { + case VALUE_MOD_OPERATOR: + ret = new CFloatValue(fmod(((CFloatValue *) val)->GetFloat(), m_int)); + break; case VALUE_ADD_OPERATOR: ret = new CFloatValue (((CFloatValue *) val)->GetFloat() + m_int); break; |