From 761ac8987799050c860f2b649d626aaa4258a8bd Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 15 Jan 2013 23:45:41 +0000 Subject: style cleanup --- source/gameengine/Expressions/InputParser.cpp | 6 +- source/gameengine/Expressions/Operator2Expr.cpp | 83 +++++++++++++------------ 2 files changed, 46 insertions(+), 43 deletions(-) (limited to 'source/gameengine/Expressions') diff --git a/source/gameengine/Expressions/InputParser.cpp b/source/gameengine/Expressions/InputParser.cpp index 5a2075d52df..ed89fb13337 100644 --- a/source/gameengine/Expressions/InputParser.cpp +++ b/source/gameengine/Expressions/InputParser.cpp @@ -260,7 +260,8 @@ void CParser::NextSym() opkind = OPless; } break; - case '\"' : { + case '\"' : + { int start; sym = constsym; constkind = stringtype; @@ -464,7 +465,8 @@ CExpression *CParser::Ex(int i) } else { switch (sym) { - case constsym: { + case constsym: + { switch (constkind) { case booltype: e1 = new CConstExpr(new CBoolValue(boolvalue)); diff --git a/source/gameengine/Expressions/Operator2Expr.cpp b/source/gameengine/Expressions/Operator2Expr.cpp index d0240b5ec75..b03d00e7f77 100644 --- a/source/gameengine/Expressions/Operator2Expr.cpp +++ b/source/gameengine/Expressions/Operator2Expr.cpp @@ -113,61 +113,61 @@ and m_rhs } -/* +#if 0 bool COperator2Expr::IsInside(float x, float y, float z,bool bBorderInclude) { bool inside; inside = false; - switch (m_op) - { - case VALUE_ADD_OPERATOR: { - // inside = first || second; // optimized with early out if first is inside - // todo: calculate smallest leaf first ! is much faster... - - bool second;//first ;//,second; - - //first = m_lhs->IsInside(x,y,z); - second = m_rhs->IsInside(x,y,z,bBorderInclude); - if (second) - return true; //early out - - // second = m_rhs->IsInside(x,y,z); + switch (m_op) { + case VALUE_ADD_OPERATOR: + { + // inside = first || second; // optimized with early out if first is inside + // todo: calculate smallest leaf first ! is much faster... - return m_lhs->IsInside(x,y,z,bBorderInclude); - - break; - } - - case VALUE_SUB_OPERATOR: { - //inside = first && !second; // optimized with early out - // todo: same as with add_operator: calc smallest leaf first + bool second;//first ;//,second; - bool second;//first ;//,second; - //first = m_lhs->IsInside(x,y,z); - second = m_rhs->IsInside(x,y,z,bBorderInclude); - if (second) - return false; + //first = m_lhs->IsInside(x,y,z); + second = m_rhs->IsInside(x,y,z,bBorderInclude); + if (second) + return true; //early out - // second space get subtracted -> negate! - //second = m_rhs->IsInside(x,y,z); + // second = m_rhs->IsInside(x,y,z); - return (m_lhs->IsInside(x,y,z,bBorderInclude)); + return m_lhs->IsInside(x,y,z,bBorderInclude); - - break; - } - default:{ - assert(false); - // not yet implemented, only add or sub csg operations - } + break; + } + + case VALUE_SUB_OPERATOR: + { + //inside = first && !second; // optimized with early out + // todo: same as with add_operator: calc smallest leaf first + + bool second;//first ;//,second; + //first = m_lhs->IsInside(x,y,z); + second = m_rhs->IsInside(x,y,z,bBorderInclude); + if (second) + return false; + + // second space get subtracted -> negate! + //second = m_rhs->IsInside(x,y,z); + + return (m_lhs->IsInside(x,y,z,bBorderInclude)); + + + break; + } + default: + { + assert(false); + // not yet implemented, only add or sub csg operations + } } return inside; } - - bool COperator2Expr::IsRightInside(float x, float y, float z,bool bBorderInclude) { return m_rhs->IsInside(x,y,z,bBorderInclude); @@ -177,7 +177,8 @@ bool COperator2Expr::IsLeftInside(float x, float y, float z,bool bBorderInclude) { return m_lhs->IsInside(x,y,z,bBorderInclude); } -*/ +#endif + bool COperator2Expr::NeedsRecalculated() { // added some lines, just for debugging purposes, it could be a one-liner :) -- cgit v1.2.3