void plRenderRequest::Render(plPipeline* pipe, plPageTreeMgr* pageMgr) { if( !fVisForce.Empty() ) { plGlobalVisMgr::Instance()->DisableNormal(); plGlobalVisMgr::Instance()->ForceVisSets(fVisForce, false); } pipe->PushRenderRequest(this); pipe->ClearRenderTarget(GetClearDrawable()); int numDrawn = 0; if( GetPageTreeMgr() ) numDrawn = GetPageTreeMgr()->Render(pipe); else numDrawn = pageMgr->Render(pipe); pipe->PopRenderRequest(this); if( GetAck() ) { plRenderRequestAck* ack = new plRenderRequestAck( GetAck(), GetUserData() ); ack->SetNumDrawn(numDrawn); plgDispatch::MsgSend( ack ); } }
// CaptureRenderRequest // void plCaptureRenderRequest::Render(plPipeline* pipe, plPageTreeMgr* pageMgr) { // If we don't have a render target, something has gone horribly wrong. if( !GetRenderTarget() ) { hsAssert(false, "CaptureRenderRequest with no render target"); return; } // Set ourselves up like the current pipeline, except with our screen size. plViewTransform vt = pipe->GetViewTransform(); vt.SetViewPort(0, 0, fRenderTarget->GetWidth(), fRenderTarget->GetHeight()); SetViewTransform(vt); SetClearColor(pipe->GetClearColor()); SetClearDepth(pipe->GetClearDepth()); // Clear our render target // Render the scene pipe->PushRenderRequest(this); plVirtualCam1::Refresh(); pipe->ClearRenderTarget(); pageMgr->Render(pipe); pipe->PopRenderRequest(this); plVirtualCam1::Refresh(); // set up state so we can clear the z-buffer for every gui dialog (and therefore not have it // be obscured by other geometry) SetRenderState(GetRenderState() & ~plPipeline::kRenderClearColor); SetRenderState(GetRenderState() | plPipeline::kRenderClearDepth); SetClearDepth(1); // render all GUI items std::vector<plPostEffectMod*> guiRenderMods = pfGameGUIMgr::GetInstance()->GetDlgRenderMods(); for (int i = (int)guiRenderMods.size() - 1; i >= 0; i--) // render in reverse, so dialogs on the bottom get rendered first { plPageTreeMgr* dlgPageMgr = guiRenderMods[i]->GetPageMgr(); if (dlgPageMgr) { SetViewTransform(guiRenderMods[i]->GetViewTransform()); pipe->PushRenderRequest(this); pipe->ClearRenderTarget(); dlgPageMgr->Render(pipe); pipe->PopRenderRequest(this); } } // Callback on plCaptureRender to process the render target into a mipmap // and send it back to the requester. plCaptureRender::IProcess(pipe, GetAck(), GetRenderTarget()); delete fRenderTarget; fRenderTarget = nil; }
int EEPROM::SendByte(unsigned char b) { //Shift a byte to EEPROM msb first. Return if EEPROM acknowledged. Returns //acknowledge bit. 0 = ACK, 1 = NACK. Clear(OUTA,SCL); //SCL low, SDA can change for(int i=0; i<8; i++) //8 reps sends 8 bits { if( b & 0x80 ) { //highest bit sets state of SDA Set(OUTA,SDA); } else { Clear(OUTA,SDA); } Set(OUTA,SCL); //Pulse the SCL line Clear(OUTA,SCL); b <<= 1; //Shift b left for next bit } return GetAck(); //Call GetByteAck and return EEPROM's Ack }
void Skeleton::Begin() { if (!GetAck("begin")) { ; } if (first || true) { m_out << "get context\n"; std::string str = GetLine(); std::istringstream istr(str); istr >> str; if ("context" != str) { ; } istr >> sizeX >> sizeY >> shipSize >> shipSpeed >> bulletLimit >> cooldown >> laserLength >> laserSpeed >> deadTimer; first = false; }