From: <re...@us...> - 2007-06-03 13:21:16
|
Revision: 27016 http://svn.sourceforge.net/crystal/?rev=27016&view=rev Author: res2002 Date: 2007-06-03 06:21:13 -0700 (Sun, 03 Jun 2007) Log Message: ----------- res merged r26420, r26439 into 1.0 (xmlshader fixes). Modified Paths: -------------- CS/branches/release/V1.0/docs/history.txt CS/branches/release/V1.0/docs/history10.txt CS/branches/release/V1.0/plugins/video/render3d/shader/shadercompiler/xmlshader/condeval.cpp CS/branches/release/V1.0/plugins/video/render3d/shader/shadercompiler/xmlshader/docwrap.cpp CS/branches/release/V1.0/plugins/video/render3d/shader/shadercompiler/xmlshader/docwrap.h Modified: CS/branches/release/V1.0/docs/history.txt =================================================================== --- CS/branches/release/V1.0/docs/history.txt 2007-06-03 13:17:10 UTC (rev 27015) +++ CS/branches/release/V1.0/docs/history.txt 2007-06-03 13:21:13 UTC (rev 27016) @@ -17,6 +17,9 @@ - res changed the installation of applications to install apps with a suffix of the version number and to create a symlink for the undecorated name. +16-Feb-2007 + - res fixed an issue in xmlshader where conditions were incorrectly + folded away. 15-Feb-2007 - res fixed the reflect and reflectsphere shaders to actually map the diffuse texture coordinates. (Reported in CS-forum:1557.) Modified: CS/branches/release/V1.0/docs/history10.txt =================================================================== --- CS/branches/release/V1.0/docs/history10.txt 2007-06-03 13:17:10 UTC (rev 27015) +++ CS/branches/release/V1.0/docs/history10.txt 2007-06-03 13:21:13 UTC (rev 27016) @@ -8,6 +8,7 @@ 3-Jun-2007 - res merged r26416 into 1.0 (shader fixes). + - res merged r26420, r26439 into 1.0 (xmlshader fixes). 31-May-2007 - res merged r26267. r26815, r26839, r26840, r26948 into 1.0 (various changes in an effort to add support for multiple CS versions being Modified: CS/branches/release/V1.0/plugins/video/render3d/shader/shadercompiler/xmlshader/condeval.cpp =================================================================== --- CS/branches/release/V1.0/plugins/video/render3d/shader/shadercompiler/xmlshader/condeval.cpp 2007-06-03 13:17:10 UTC (rev 27015) +++ CS/branches/release/V1.0/plugins/video/render3d/shader/shadercompiler/xmlshader/condeval.cpp 2007-06-03 13:21:13 UTC (rev 27016) @@ -33,14 +33,14 @@ ValueSet& Variables::Values::GetMultiValue (uint num) { ValueSetChain* p = multiValues; - while (num > 0) p = p->nextPlease; + while (num-- > 0) p = p->nextPlease; return p->vs; } const ValueSet& Variables::Values::GetMultiValue (uint num) const { ValueSetChain* p = multiValues; - while (num > 0) p = p->nextPlease; + while (num-- > 0) p = p->nextPlease; return p->vs; } @@ -2009,13 +2009,18 @@ CS_ASSERT (b.type == operandOperation); if (rA.state == Logic3::Truth) { + /* A is definitely true: so the possible values for a true/false outcome + * are those of evaluating B. */ rB = evaluator.CheckConditionResults (b.operation, trueVarsA, trueVars, falseVars); } else if (rA.state == Logic3::Lie) { - rB = evaluator.CheckConditionResults (b.operation, - falseVarsA, trueVars, falseVars); + /* A is definitely false: so the possible values for a true/false outcome + * are those of evaluating A. */ + trueVars = trueVarsA; + falseVars = falseVarsA; + rB = Logic3::Uncertain; } else { @@ -2055,16 +2060,19 @@ vars, trueVarsA, falseVarsA); Logic3 rB; - Variables trueVarsB; - Variables falseVarsB; CS_ASSERT (b.type == operandOperation); if (rA.state == Logic3::Truth) { - rB = evaluator.CheckConditionResults (b.operation, - trueVarsA, trueVars, falseVars); + /* A is definitely true: so the possible values for a true/false outcome + * are those of evaluating A. */ + trueVars = trueVarsA; + falseVars = falseVarsA; + rB = Logic3::Uncertain; } else if (rA.state == Logic3::Lie) { + /* A is definitely false: so the possible values for a true/false outcome + * are those of evaluating B. */ rB = evaluator.CheckConditionResults (b.operation, falseVarsA, trueVars, falseVars); } Modified: CS/branches/release/V1.0/plugins/video/render3d/shader/shadercompiler/xmlshader/docwrap.cpp =================================================================== --- CS/branches/release/V1.0/plugins/video/render3d/shader/shadercompiler/xmlshader/docwrap.cpp 2007-06-03 13:17:10 UTC (rev 27015) +++ CS/branches/release/V1.0/plugins/video/render3d/shader/shadercompiler/xmlshader/docwrap.cpp 2007-06-03 13:21:13 UTC (rev 27016) @@ -43,11 +43,7 @@ CS_PLUGIN_NAMESPACE_BEGIN(XMLShader) { -// Hack: Work around problems caused by #defining 'new'. -#if defined(CS_EXTENSIVE_MEMDEBUG) || defined(CS_MEMORY_TRACKER) -# undef new -#endif -#include <new> +#include "csutil/custom_new_disable.h" class ConditionTree { @@ -98,7 +94,7 @@ csConditionNode* parent); bool HasContainingCondition (Node* node, csConditionID containedCondition, - csConditionID& condition); + csConditionID& condition, int& branch); csConditionEvaluator& evaluator; public: @@ -194,8 +190,9 @@ if (node->condition == Node::csCondUnknown) { csConditionID containerCondition; + int containingBranch; bool hasContainer = HasContainingCondition (node, condition, - containerCondition); + containerCondition, containingBranch); node->condition = condition; node->conditionAffectedSVs = affectedSVs; @@ -232,14 +229,18 @@ { evaluator.CheckConditionResults (containerCondition, trueVals, newTrueVals, newFalseVals); - nn->values = newTrueVals; } else { evaluator.CheckConditionResults (containerCondition, falseVals, newTrueVals, newFalseVals); + } + /* Pick the results for the branch of the containing condition + * the contained one appears in. */ + if (containingBranch == 0) + nn->values = newTrueVals; + else nn->values = newFalseVals; - } } else { @@ -335,14 +336,19 @@ bool ConditionTree::HasContainingCondition (Node* node, csConditionID containedCondition, - csConditionID& condition) + csConditionID& condition, + int& branch) { if (node->parent == 0) return false; condition = node->parent->condition; if (evaluator.IsConditionPartOf (containedCondition, condition) && (containedCondition != condition)) + { + branch = (node == node->parent->branches[0]) ? 0 : 1; return true; - return HasContainingCondition (node->parent, containedCondition, condition); + } + return HasContainingCondition (node->parent, containedCondition, condition, + branch); } //--------------------------------------------------------------------------- Modified: CS/branches/release/V1.0/plugins/video/render3d/shader/shadercompiler/xmlshader/docwrap.h =================================================================== --- CS/branches/release/V1.0/plugins/video/render3d/shader/shadercompiler/xmlshader/docwrap.h 2007-06-03 13:17:10 UTC (rev 27015) +++ CS/branches/release/V1.0/plugins/video/render3d/shader/shadercompiler/xmlshader/docwrap.h 2007-06-03 13:21:13 UTC (rev 27016) @@ -38,11 +38,7 @@ #include "condeval.h" #include "docwrap_replacer.h" -// Hack: Work around problems caused by #defining 'new'. -#if defined(CS_EXTENSIVE_MEMDEBUG) || defined(CS_MEMORY_TRACKER) -# undef new -#endif -#include <new> +#include "csutil/custom_new_disable.h" CS_PLUGIN_NAMESPACE_BEGIN(XMLShader) { @@ -403,8 +399,6 @@ } CS_PLUGIN_NAMESPACE_END(XMLShader) -#if defined(CS_EXTENSIVE_MEMDEBUG) || defined(CS_MEMORY_TRACKER) -# define new CS_EXTENSIVE_MEMDEBUG_NEW -#endif +#include "csutil/custom_new_enable.h" #endif // __CS_DOCWRAP_H__ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |