Index: source/simulation2/system/ComponentManager.cpp
===================================================================
--- source/simulation2/system/ComponentManager.cpp
+++ source/simulation2/system/ComponentManager.cpp
@@ -1104,28 +1104,16 @@
std::string CComponentManager::GenerateSchema() const
{
- std::string numericOperation =
- ""
- ""
- ""
- "add"
- "mul"
- ""
- ""
- "";
std::string schema =
""
""
""
- + numericOperation +
""
""
"0"
- + numericOperation +
""
""
"0"
- + numericOperation +
""
""
""
Index: source/simulation2/system/ParamNode.cpp
===================================================================
--- source/simulation2/system/ParamNode.cpp
+++ source/simulation2/system/ParamNode.cpp
@@ -83,7 +83,8 @@
enum op {
INVALID,
ADD,
- MUL
+ MUL,
+ MUL_ROUND
} op = INVALID;
bool replacing = false;
bool filtering = false;
@@ -117,6 +118,8 @@
op = ADD;
else if (std::wstring(attr.Value.begin(), attr.Value.end()) == L"mul")
op = MUL;
+ else if (std::wstring(attr.Value.begin(), attr.Value.end()) == L"mul_round")
+ op = MUL_ROUND;
else
LOGWARNING("Invalid op '%ls'", attr.Value);
}
@@ -178,7 +181,10 @@
node.m_Value = (oldval + mod).ToString().FromUTF8();
break;
case MUL:
- node.m_Value = (oldval.Multiply(mod)).ToString().FromUTF8();
+ node.m_Value = oldval.Multiply(mod).ToString().FromUTF8();
+ break;
+ case MUL_ROUND:
+ node.m_Value = fixed::FromInt(oldval.Multiply(mod).ToInt_RoundToNearest()).ToString().FromUTF8();
break;
}
hasSetValue = true;