//------------------------------------------------------------------------------------------------------- void RealLightNode::Update( uint milisecon ) { bool ischange = isChange(); LightNode::Update( milisecon ); m_isCastShadow = false; if( m_pShadowCaster ) { m_pShadowCaster->Update( *this, *Engine::Instance().GetCamera(), ischange ); m_isCastShadow = m_pShadowCaster->isCastShadow(); } }
//------------------------------------------------------------------------------------------------------- void LightNode::Update( uint milisecon ) { if( isChange() || isFatherChange() || m_isLightChange ) { if ( isChange() || isFatherChange() ) { LocatableObject::Update( milisecon ); vector3f ws = GetWorldScale(); m_MaxScale = Math::GetMin( ws.m_x, Math::GetMin( ws.m_y, ws.m_z ) ); if ( m_eLightType != LT_POINT ) { m_WorldDirection = LightDirectionRaw * GetWorldRotation(); m_WorldUp = LightUpRaw * GetWorldRotation(); } CastChangedMessage();//通知子节点 _SetChangeFlag( false ); } m_isLightChange = false; _OnLightChangeRecaculater();//告诉自己的继承类,灯光变了 } }
void cpu_exec(volatile uint32_t n) { volatile uint32_t n_temp = n; setjmp(jbuf); for(; n > 0; n --) { swaddr_t eip_temp = cpu.eip; BP* current; /*如果触发断点成功且eip-1恰好是int3指令*/ if(isBreak == true && swaddr_read(cpu.eip-1,1) == INT3_CODE) { cpu.eip--; current = ret_head();//返回组织使用中断点的head指针 while(current -> addr != cpu.eip)//找存放相应内存地址的断点结构 current = current -> next; swaddr_write(cpu.eip,1,current -> sav_istr);//临时恢复原来的指令 eip_temp--; } int instr_len = exec(cpu.eip); /*刚执行完恢复的指令要马上设置回断点,使其能反复触发*/ if(isBreak == true && swaddr_read(eip_temp,1) != INT3_CODE)//刚触发断点但断点的位置刚被恢复为原指令 { swaddr_write(eip_temp,1,INT3_CODE); isBreak = false;//告别刚刚触发的那个断点,初始化isBreak,否则执行下一条正常指令也会进入这个判断 } if(!isChange()) isBreak = true; cpu.eip += instr_len; if(n_temp != -1 || (enable_debug && !quiet)) { print_bin_instr(eip_temp, instr_len); puts(assembly); } if(nemu_state == INT) { printf("\n\nUser interrupt\n"); return; } else if(isBreak == true) { return; }//如果因触发断点而停止,回到主循环等待下一条指令 else if(nemu_state == END) { return; } } }
void MultiObjectSeg::showChangePoints(vector<IndexType>& changePs, Sample& pCLoud) { vector<bool> isChange(pCLoud.num_vertices(),false); for (auto cIter = changePs.begin(); cIter != changePs.end(); ++ cIter) { isChange[(*cIter)] = true; } IndexType i = 0; for (Sample::vtx_iterator vIter = pCLoud.begin(); vIter != pCLoud.end(); ++ vIter, ++i) { if (isChange[i]) { //(*vIter)->set_visble(false); (*vIter)->set_label(2); } } }
char Compiler::getCommand() { char ch; do { if(*mInput) { ch = mInput->get(); } else { ch = 0; break; } } while( !isMove(ch) and !isChange(ch) and !isIO(ch) and !isLoop(ch) ); return ch; }
//-------------------------------------------------------------------------------------------------------------------------------------- void LocatableModel::Update( uint milisecon ) { bool islocatablechange = isChange(); LocatableObject::Update(milisecon); _SetForceUpdataJoint( islocatablechange ); if ( _isBone() && _isInview() ) { vector3f disdir = GetWorldPosition() - Engine::Instance().GetCamera()->GetPosition(); vector3f boxdiag = ( m_BindBox.GetMax() - m_BindBox.GetMin() ); float dispow = disdir.Dot( disdir ); float boxsize = boxdiag.Dot( boxdiag ); _SetRefreshLimit( Utility::CaculateRefreshLimit(dispow, boxsize) ); } Model::Update( milisecon ); if ( islocatablechange || isFatherChange() ) { Matrix44f* trans = (Matrix44f*)(this->Attribute( IAttributeNode::ATT_WORLDTRANSFORM )); m_BindBox = NULL == trans ? m_OgiBindBox : m_OgiBindBox * *trans; } }
void InMapItemDialog::cancel_click() { qDebug() << "onCancelClick"; if(!isChange())delete this->returnItem; this->returnItem = 0; }
bool Compiler::compile(std::istream& input) { mInput = &input; mInstructions.clear(); std::stack<int> loopStack; char command; command = getCommand(); while(command) { int move = 0; while(command and isMove(command)) { if(command == '>') { move++; } else { move--; } command = getCommand(); } if(move != 0) { push(op_move); push(move); } int change = 0; while(command and isChange(command)) { if(command == '+') { change++; } else { change--; } command = getCommand(); } if(change != 0) { push(op_change); push(change); } while(command and isIO(command)) { if(command == '.') { push(op_output); } else { push(op_input); } command = getCommand(); } while(command and isLoop(command)) { if(command == '[') { loopStack.push(mInstructions.size()); push(op_loop_begin); push(-1); } else { if(loopStack.empty()) { mError = "unopened ]"; return false; } else { push(op_loop_end); mInstructions[loopStack.top() + 1].param = mInstructions.size(); loopStack.pop(); } } command = getCommand(); } } if(not loopStack.empty()) { mError = "unclosed ["; return false; } push(op_stop); return true; }