bool CDasherInterfaceBase::Redraw(unsigned long ulTime, bool bRedrawNodes, CExpansionPolicy &policy) { DASHER_ASSERT(m_pDasherView); // Draw the nodes if(bRedrawNodes) { m_pDasherView->Screen()->SendMarker(0); if (m_pDasherModel) { m_pDasherModel->RenderToView(m_pDasherView,policy); // if anything was expanded or collapsed render at least one more // frame after this if (policy.apply()) ScheduleRedraw(); } if(m_pGameModule) { m_pGameModule->DecorateView(ulTime, m_pDasherView, m_pDasherModel); } } //From here on, we'll use bRedrawNodes just to denote whether we need to blit the display... // Draw the decorations m_pDasherView->Screen()->SendMarker(1); if(m_pInputFilter) { if (m_pInputFilter->DecorateView(m_pDasherView, m_pInput)) bRedrawNodes=true; } return bRedrawNodes; }
bool CDasherModel::RenderToView(CDasherView *pView, CExpansionPolicy &policy) { DASHER_ASSERT(pView != NULL); DASHER_ASSERT(m_Root != NULL); // XXX we HandleOutput in RenderToView // DASHER_ASSERT(Get_node_under_crosshair() == m_pLastOutput); bool bReturnValue = false; std::vector<std::pair<myint,bool> > vGameTargetY; // The Render routine will fill iGameTargetY with the Dasher Coordinate of the // youngest node with NF_GAME set. The model is responsible for setting NF_GAME on // the appropriate Nodes. pView->Render(m_Root, m_Rootmin + m_iDisplayOffset, m_Rootmax + m_iDisplayOffset, policy, true, &vGameTargetY); /////////GAME MODE TEMP////////////// if(m_bGameMode) if(GameMode::CDasherGameMode* pTeacher = GameMode::CDasherGameMode::GetTeacher()) pTeacher->SetTargetY(vGameTargetY); ////////////////////////////////////// // TODO: Fix up stats // TODO: Is this the right way to handle this? HandleOutput(NULL, NULL); //ACL Off-screen nodes (zero collapse cost) will have been collapsed already. //Hence, this acts to maintain the node budget....or whatever the queue's policy is! if (policy.apply(m_pNodeCreationManager,this)) bReturnValue=true; return bReturnValue; }