]> git.sesse.net Git - stockfish/blobdiff - src/evaluate.cpp
Move RootColor from Eval to Search
[stockfish] / src / evaluate.cpp
index fdfacc10b910f71d0a7a802afd8f0d8d33efda46..c7549ce29237d41f8586cf9dab8a03fccbdb435e 100644 (file)
@@ -267,9 +267,6 @@ namespace {
 
 namespace Eval {
 
-  Color RootColor;
-  Value ValueDrawContempt;
-
   /// evaluate() is the main evaluation function. It always computes two
   /// values, an endgame score and a middle game score, and interpolates
   /// between them based on the remaining material.
@@ -308,8 +305,6 @@ namespace Eval {
         KingDangerTable[1][i] = apply_weight(make_score(t, 0), Weights[KingDangerUs]);
         KingDangerTable[0][i] = apply_weight(make_score(t, 0), Weights[KingDangerThem]);
     }
-
-    ValueDrawContempt = VALUE_DRAW - Options["Contempt Factor"] * PawnValueMg / 100;
   }
 
 
@@ -322,7 +317,7 @@ namespace Eval {
     Value margin;
     std::string totals;
 
-    RootColor = pos.side_to_move();
+    Search::RootColor = pos.side_to_move();
 
     TraceStream.str("");
     TraceStream << std::showpoint << std::showpos << std::fixed << std::setprecision(2);
@@ -856,8 +851,8 @@ Value do_evaluate(const Position& pos, Value& margin) {
         // value that will be used for pruning because this value can sometimes
         // be very big, and so capturing a single attacking piece can therefore
         // result in a score change far bigger than the value of the captured piece.
-        score -= KingDangerTable[Us == Eval::RootColor][attackUnits];
-        margins[Us] += mg_value(KingDangerTable[Us == Eval::RootColor][attackUnits]);
+        score -= KingDangerTable[Us == Search::RootColor][attackUnits];
+        margins[Us] += mg_value(KingDangerTable[Us == Search::RootColor][attackUnits]);
     }
 
     if (Trace)