VideoCaptureView::VideoCaptureView(QWidget *parent, Qt::WFlags fl): QWidget(parent, fl), m_cleared(false), m_tidUpdate(0) { m_capture = camera::VideoCaptureDeviceFactory::createVideoCaptureDevice(); setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding)); // Optimize paint event setAttribute(Qt::WA_NoSystemBackground); QPalette pal(palette()); pal.setBrush(QPalette::Window, Qt::black); setPalette(pal); setLive(); m_doZoom = false; m_zoomlevel = 0; m_zoomfactor = 1.0; m_minZoom = 0; m_maxZoom = 2; m_force = false; }
VideoCaptureView::VideoCaptureView(QWidget * parent, const char *name, WFlags fl):QWidget(parent, name, fl) { capture = new VideoCapture(); QSizePolicy sp(QSizePolicy::Expanding, QSizePolicy::Expanding); setSizePolicy(sp); tid_update = 0; setLive(); }
void Particle::update() { m_vx1 += m_ax1; m_vy1 += m_ay1; m_x1 += m_vx1; m_y1 += m_vy1; m_vx2 += m_ax2; m_vy2 += m_ay2; m_x2 += m_vx2; m_y2 += m_vy2; if (m_y1 >= m_pWorld->cameraHeight()) { setLive(false); } }
void Goomba::update() { if ( m_px + m_width <= 0 || m_px >= m_pWorld->map().totalWidth() || m_py >= m_pWorld->map().totalHeight() ) { setLive(false); return; } if (m_state == DYING) { m_dyingFrameCount++; if (m_dyingFrameCount >= GOOMBA_MAX_DYING_FRAME) { setLive(false); } return; } if (m_state == THROWING) { if ( m_py >= m_pWorld->map().totalHeight() ) { setLive(false); return; } } else // LIVING { if (!m_vy && checkFalling()) { m_vy = GOOMBA_VY; m_ay = GOOMBA_GRAVITY; } } Entity::updateMovement(); }
void Particle::startLife() { m_x1 = m_y1 = 0.0f; m_x2 = m_y2 = 0.0f; m_ax1 = 0.512f; m_ay1 = 5.12f; m_ax2 = 0.512f; m_ay2 = 5.12f; m_vx1 = 0.16f; m_vy1 = -32.0f; m_vx2 = 0.8f; m_vy2 = -24.0f; m_prevpx = m_px; m_prevpy = m_py; setLive(true); }
ABST::ABST() { memcpy(data + 4, "abst", 4); setVersion(0); setFlags(0); setBootstrapinfoVersion(0); setProfile(0); setLive(1); setUpdate(0); setTimeScale(1000); setCurrentMediaTime(0); setSmpteTimeCodeOffset(0); std::string empty; setMovieIdentifier(empty); setInt8(0, 30); //set serverentrycount to 0 setInt8(0, 31); //set qualityentrycount to 0 setDrmData(empty); setMetaData(empty); }
void Goomba::startLife() { if (!m_canStartLife) return; m_canStartLife = false; m_isFacingRight = m_originalFacingRight; m_ax = m_ay = 0; m_vx = m_isFacingRight ? GOOMBA_VX : -GOOMBA_VX; m_vy = 0; m_px = m_originalX; m_py = m_originalY; m_prevpx = m_px; m_prevpy = m_py; m_state = LIVING; setLive(true); }
void MemMap::sinkStores(StoreList& stores) { // sink dead stores into exit edges that occur between the dead store and the // next store StoreList::reverse_iterator it, end; for (it = stores.rbegin(), end = stores.rend(); it != end; ++it) { IRInstruction* store = it->first; if (isLive(store)) continue; for (IRInstruction* guard : it->second) { Block* exit = guard->getTaken(); exit->prepend(store->clone(m_factory)); } // StRefs cannot just be removed, they have to be converted into Movs // as the destination of the StRef still has the DecRef attached to it. if (store->getOpcode() == StRef || store->getOpcode() == StRefNT) { store->setOpcode(Mov); store->setSrc(1, nullptr); store->setNumSrcs(1); setLive(*store, true); } } }
void VideoCaptureView::setStill(const QImage & i) { setLive(-1); img = i; repaint(TRUE); }
void SignalSlotConnection::setSlot(QString slot) { Q_D(SignalSlotConnection); d->_slot = slot; setLive(true); }
void SignalSlotConnection::setSignal(QString signal) { Q_D(SignalSlotConnection); d->_signal = signal; setLive(true); }
void VideoCaptureView::setStill(const QImage& i) { setLive(-1); m_image = i; repaint(); }
void MemMap::optimizeMemoryAccesses(Trace* trace) { if (hasInternalFlow(trace)) { // This algorithm only works with linear traces. // TODO t2066994: reset state after each block, at least. return; } StoreList tracking; const Func* curFunc = nullptr; for (Block* block : trace->getBlocks()) { for (IRInstruction& inst : *block) { if (inst.getOpcode() == Marker) { curFunc = inst.getExtra<Marker>()->func; } // initialize each instruction as live setLive(inst, true); int offset = -1; Opcode op = inst.getOpcode(); if (isLoad(op)) { if (op == LdProp) { offset = inst.getSrc(1)->getValInt(); } // initialize each instruction as live setLive(inst, true); optimizeLoad(&inst, offset); } else if (isStore(op)) { if (op == StProp || op == StPropNT) { offset = inst.getSrc(1)->getValInt(); } // if we see a store, first check if its last available access is a store // if it is, then the last access is a dead store auto access = inst.getOpcode() == StLoc || inst.getOpcode() == StLocNT ? lastLocalAccess(inst.getExtra<LocalId>()->locId) : getLastAccess(inst.getSrc(0), offset); if (access && isStore(access->getOpcode())) { // if a dead St* is followed by a St*NT, then the second store needs to // now write in the type because the first store will be removed if (access->getOpcode() == StProp && op == StPropNT) { inst.setOpcode(StProp); } else if (access->getOpcode() == StLoc && op == StLocNT) { inst.setOpcode(StLoc); } else if (access->getOpcode() == StRef && op == StRefNT) { inst.setOpcode(StRef); } setLive(*access, false); } // start tracking the current store tracking.push_back(std::make_pair(&inst, std::vector<IRInstruction*>())); } else if (inst.mayRaiseError()) { // if the function has an exit edge that we don't know anything about // (raising an error), then all stores we're currently tracking need to // be erased. all stores already declared dead are untouched StoreList::iterator it, end; for (it = tracking.begin(), end = tracking.end(); it != end; ) { StoreList::iterator copy = it; ++it; if (isLive(copy->first)) { // XXX: t1779667 tracking.erase(copy); } } } // if the current instruction is guarded, make sure all of our stores that // are not yet dead know about it if (inst.getTaken()) { for (auto& entry : tracking) { if (isLive(entry.first)) { entry.second.push_back(&inst); } } } Simplifier::copyProp(&inst); processInstruction(&inst, curFunc && curFunc->isPseudoMain()); } } sinkStores(tracking); // kill the dead stores removeDeadInstructions(trace, m_liveInsts); }