[dasher: 3/38] Fix Game Mode failing to locate the game target when inside an off-path sibling



commit c9d7bc6768aafac1f6487386eea4404821db1470
Author: Alan Lawrence <acl33 inf phy cam ac uk>
Date:   Fri Nov 25 19:45:29 2011 +0000

    Fix Game Mode failing to locate the game target when inside an off-path sibling
    
    by forcing DasherViewSquare to render all children of an NF_GAME node
      (and not use the m_onlyChildRendered optimization)

 Src/DasherCore/DasherViewSquare.cpp |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)
---
diff --git a/Src/DasherCore/DasherViewSquare.cpp b/Src/DasherCore/DasherViewSquare.cpp
index e777ca2..d321078 100644
--- a/Src/DasherCore/DasherViewSquare.cpp
+++ b/Src/DasherCore/DasherViewSquare.cpp
@@ -761,7 +761,6 @@ beginning:
   }
 
   //ok, need to render all children...
-  bool bExpectGameNode(pRender->GetFlag(NF_GAME));
   myint newy1=y1,newy2;
   CDasherNode::ChildMap::const_iterator I = pRender->GetChildren().begin(), E = pRender->GetChildren().end();
   while (I!=E) {
@@ -769,8 +768,6 @@ beginning:
 
     newy2 = y1 + (Range * pChild->Hbnd()) / CDasherModel::NORMALIZATION;
     if (pChild->GetFlag(NF_GAME)) {
-      DASHER_ASSERT(bExpectGameNode);
-      bExpectGameNode=false;
       CGameNodeDrawEvent evt(pChild, newy1, newy2);
       Observable<CGameNodeDrawEvent*>::DispatchEvent(&evt);
     }
@@ -779,8 +776,9 @@ beginning:
         //definitely big enough to render.
         NewRender(pChild, newy1, newy2, pPrevText, policy, dMaxCost, pOutput);
       } else if (!pChild->GetFlag(NF_SEEN)) pChild->Delete_children();
-      if (newy2>iDasherMaxY && !bExpectGameNode) {
-        //remaining children offscreen and no game-mode child among them
+      if (newy2>iDasherMaxY && !pRender->GetFlag(NF_GAME)) {
+        //remaining children offscreen and no game-mode child we might skip
+        // (among the remainder, or any previous off the top of the screen)
         if (newy1 < iDasherMinY) pRender->onlyChildRendered = pChild; //previous children also offscreen!
         break; //skip remaining children
       }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]