int CHeaderCtrlExt::FindVisibleItem(int nIndex) { if(GetVisible(nIndex))return nIndex; int nOrder = IndexToOrder(nIndex); while(nOrder > 0) { nIndex = OrderToIndex(--nOrder); if(GetVisible(nIndex))return nIndex; } return -1; }
void CProgressBar::Update() { if( GetVisible() && CGuiElement::m_bIsActive ) { m_sText = std::to_string((long double)((int)m_fProgress)); } }
/** * (This description applies for the glictContainer::Paint(). If you are * reading it for some other class, then its documentation is not written * yet for this function.) * * In glictContainer class, Paint does nothing except calling SetScissor() and * CPaint(). This is because as a widget the container class does not render * anything; it serves as a point of divergence for other classes. * Other widgets should define their own procedure with these two calls * as a minimum. * * When writing a widget, put SetScissor() on the beginning of this * function, and CPaint() on the end. * * \sa SetScissor(), CPaint() */ void glictContainer::Paint() { if (!GetVisible()) return; this->SetScissor(); this->CPaint(); }
void Widget::DoRender( Graphics& g ) const { if (!GetVisible()) return; Transform2d tr = g.GetTransform(); g.SetTransform(tr.translated(GetPos())); Render(g); g.SetTransform(tr); }
void SQRChartLineGraph::OnRender() { if(GetVisible() == false || Empty()) return; // 绘制常数计算 CFRect wndRect; m_phost->GetWndRect(wndRect); const float height = wndRect.bottom - wndRect.top; //const float zoomSize = m_phost->m_hWnd->m_pGUI->GetZoomSize(); const PointGroup default_pg = {CVector3f(0.0f, 0.0f, 0.0f), GetColor()}; // 绘制数据准备 UIVector<PointGroup> pgList(Count(), default_pg); for(size_t i = 0; i < Count(); i++) { pgList[i].vPoint.x = (wndRect.left + i * m_spanX + m_deltaX);// * zoomSize; pgList[i].vPoint.y = (wndRect.top + height - m_data[i] * m_zoomY - m_deltaY);// * zoomSize; } // 数据点的绘制 for(UIVector<PointGroup>::const_iterator it = pgList.begin(); it != pgList.end(); ++it) { CFRect rect(it->vPoint.x - 2, it->vPoint.y - 2, it->vPoint.x + 2, it->vPoint.y + 2); m_phost->GetGraphic()->DrawRect(rect, m_color, NULL); } // 线的绘制 if(pgList.size() > 1) { m_phost->GetGraphic()->DrawLine(&(pgList[0]), static_cast<int32>(pgList.size()), true, m_phost->GetWndHandle()->m_eRS ); } }
// Updates the spawner object. void SpawnerObject::Update( float elapsed, bool addVelocity ) { // Allow the base scene object to update. SceneObject::Update( elapsed, addVelocity ); // Check if the spawner is not visible if( GetVisible() == false ) { // The spawner will become visible again after the set amount of time (frequency) has passed. m_spawnTimer += elapsed; if( m_spawnTimer >= m_frequency ) { SetVisible( true ); SetIgnoreCollisions( false ); m_spawnTimer = 0.0f; } } // Update the collect sound's audio path. if( m_audioPath != NULL ) { m_audioPath->SetPosition( GetTranslation() ); m_audioPath->SetVelocity( GetVelocity() ); } }
void CGUITextBox::Draw(CGraphicsHandler *g){ if(GetVisible()){ UpdateBB(); if(m_pSprites){ if(m_bButtonDown && m_bMouseOver && m_pSprites->Button->MouseDown && m_bEnabled) g->DrawSpriteTL(m_pSprites->Button->MouseDown, 0, m_pos); else if((m_bMouseOver || m_bButtonDown) && m_pSprites->Button->MouseOver && m_bEnabled) g->DrawSpriteTL(m_pSprites->Button->MouseOver, 0, m_pos); else if(m_pSprites->Button->Default) g->DrawSpriteTL(m_pSprites->Button->Default, 0, m_pos); }else if(m_pColors) g->DrawRectTL(m_pos, m_width, m_height, m_pColors->BG, m_border, m_pColors->Border); if((m_Caretx!=m_SelStartx || m_Carety!=m_SelStarty) && GetFocus()){ if(m_SelStarty==m_Carety && !(m_SelStarty<m_Scrolly) && !(m_SelStarty>=m_Scrolly+((int)(m_height/13)))) g->DrawRectTL(Vector2(m_pos.x+m_border+2+(m_SelStartx-m_Scrollx)*8, m_pos.y+m_border+2+(m_SelStarty-m_Scrolly)*13), (m_Caretx-m_SelStartx)*8, 13, ColorARGB(255, 0,0,255)); else{ if(m_Carety>m_SelStarty){ if(!(m_SelStarty<m_Scrolly) && !(m_SelStarty>=m_Scrolly+((int)(m_height/13)))) g->DrawRectTL(Vector2(m_pos.x+m_border+2+(m_SelStartx-m_Scrollx)*8, m_pos.y+m_border+2+(m_SelStarty-m_Scrolly)*13), m_Text[m_SelStarty].substr(m_SelStartx).length()*8, 13, ColorARGB(255, 0,0,255)); for(UINT a=m_SelStarty+1; a<m_Carety; a++) if(!(a<m_Scrolly) && !(a>=m_Scrolly+((int)(m_height/13)))) g->DrawRectTL(Vector2(m_pos.x+m_border+2+(-(int)m_Scrollx)*8, m_pos.y+m_border+2+(a-m_Scrolly)*13), m_Text[a].length()*8, 13, ColorARGB(255, 0,0,255)); if(!(m_Carety<m_Scrolly) && !(m_Carety>=m_Scrolly+((int)(m_height/13)))) g->DrawRectTL(Vector2(m_pos.x+m_border+2+(-(int)m_Scrollx)*8, m_pos.y+m_border+2+(m_Carety-m_Scrolly)*13), m_Text[m_Carety].substr(0, m_Caretx).length()*8, 13, ColorARGB(255, 0,0,255)); }else{ if(!(m_SelStarty<m_Scrolly) && !(m_SelStarty>=m_Scrolly+((int)(m_height/13)))) g->DrawRectTL(Vector2(m_pos.x+m_border+2+(m_SelStartx-(int)m_Scrollx)*8, m_pos.y+m_border+2+(m_SelStarty-(int)m_Scrolly)*13), -(int)m_Text[m_SelStarty].substr(0, m_SelStartx).length()*8, 13, ColorARGB(255, 0,0,255)); for(UINT a=m_SelStarty-1; a>m_Carety; a--) if(!(a<m_Scrolly) && !(a>=m_Scrolly+((int)(m_height/13)))) g->DrawRectTL(Vector2(m_pos.x+m_border+2+(-(int)m_Scrollx)*8, m_pos.y+m_border+2+(a-m_Scrolly)*13), m_Text[a].length()*8, 13, ColorARGB(255, 0,0,255)); if(!(m_Carety<m_Scrolly) && !(m_Carety>=m_Scrolly+((int)(m_height/13)))) g->DrawRectTL(Vector2(m_pos.x+m_border+2+(m_Text[m_Carety].length())*8, m_pos.y+m_border+2+(m_Carety-(int)m_Scrolly)*13), -(int)m_Text[m_Carety].substr(m_Caretx).length()*8, 13, ColorARGB(255, 0,0,255)); } } } if(m_TextDraw!=L"" && m_pColors){ //if(m_Carety==m_SelStarty) g->DrawTextTL(m_TextDraw, Vector2(m_pos.x+m_border+2, m_pos.y+m_border+3), m_pColors->Text); //else{ //g->DrawTextTL(m_TextDraw, Vector2(m_pos.x+m_border+2, m_pos.y+m_border+3), ColorARGB(255, 255, 0,0)); //} } if(m_bCaretOn && GetFocus() && m_bSelectable && !(m_Carety<m_Scrolly) && !(m_Carety>=m_Scrolly+((int)(m_height/13)))) g->DrawRectTL(Vector2(m_pos.x+m_border+2+(m_Caretx-m_Scrollx)*8, m_pos.y+m_border+2+(m_Carety-m_Scrolly)*13), 1, 13, ColorARGB(255, 0,0,0)); if(m_pVSB!=NULL) m_pVSB->Draw(g); if(m_pHSB!=NULL) m_pHSB->Draw(g); if(!GetEnabled()) g->DrawRectTL(m_pos, m_width, m_height, ColorARGB(128, 128, 128, 128)); else if(m_bMouseOver && m_pSprites && m_pSprites->Cursor) g->DrawSpriteTL(m_pSprites->Cursor, 0, m_pos); } }
void HeightmapNode::Draw() { if (!GetVisible())return; SceneNode::Draw(); if(heightmapTexture) { RenderManager::Instance()->SetRenderEffect(RenderManager::TEXTURE_MUL_FLAT_COLOR); RenderManager::Instance()->SetTexture(heightmapTexture, 0); RenderManager::Instance()->SetRenderData(renderDataObject); RenderManager::Instance()->FlushState(); RenderManager::Instance()->HWDrawElements(PRIMITIVETYPE_TRIANGLELIST, (heightmap->Size() - 1) * (heightmap->Size() - 1) * 6, EIF_32, &debugIndices.front()); } if(cursor) { RenderManager::Instance()->AppendState(RenderStateBlock::STATE_BLEND); eBlendMode src = RenderManager::Instance()->GetSrcBlend(); eBlendMode dst = RenderManager::Instance()->GetDestBlend(); RenderManager::Instance()->SetBlendMode(BLEND_SRC_ALPHA, BLEND_ONE_MINUS_SRC_ALPHA); RenderManager::Instance()->SetDepthFunc(CMP_LEQUAL); cursor->Prepare(); RenderManager::Instance()->HWDrawElements(PRIMITIVETYPE_TRIANGLELIST, (heightmap->Size() - 1) * (heightmap->Size() - 1) * 6, EIF_32, &debugIndices.front()); RenderManager::Instance()->SetDepthFunc(CMP_LESS); RenderManager::Instance()->RemoveState(RenderStateBlock::STATE_BLEND); RenderManager::Instance()->SetBlendMode(src, dst); } }
// Override this method to serialize specific properties bool UIPicture::OnSerializeFrom(GTTreeNode* pTreeNode) { if(NULL == pTreeNode) return false; UIWidgetSprite::OnSerializeFrom(pTreeNode); // PieceEnabled is not defined so check Image node if(false == m_Sprite.HasSprite()) { // Read Image node GTTreeNode* pImageNode = pTreeNode->FindChild(GTPropertyFile::TagImage); // Create static sprite object if(NULL == pImageNode) return false; m_pSprite = GameObjectCreation::CreateStaticSprite( pImageNode->GetValue().ToCharString(), // Image file name GetParent()->GetZOrder() // User parent's z-order ); if(NULL == m_pSprite) return false; } if(m_pSprite) { // Setup position m_pSprite->SetPosition(GetPosition()); // Setup ZOrder m_pSprite->SetZOrder(GetZOrder()); // Setup Visible m_pSprite->SetVisible(GetVisible()); } return true; }
void Sprite_Character::Update() { Sprite::Update(); Rect r; if (tile_id != character->GetTileId() || character_name != character->GetCharacterName() || character_index != character->GetCharacterIndex()) { tile_id = character->GetTileId(); character_name = character->GetCharacterName(); character_index = character->GetCharacterIndex(); if (tile_id > 0) { BitmapRef tile = Cache::Tile(Game_Map::GetChipsetName(), tile_id); SetBitmap(tile); r.Set(0, 0, 16, 16); SetSrcRect(r); SetOx(8); SetOy(16); } else { if (character_name.empty()) { SetBitmap(BitmapRef()); } else { SetBitmap(Cache::Charset(character_name)); chara_width = GetBitmap()->GetWidth() / 4 / 3; chara_height = GetBitmap()->GetHeight() / 2 / 4; SetOx(chara_width / 2); SetOy(chara_height); int sx = (character_index % 4) * chara_width * 3; int sy = (character_index / 4) * chara_height * 4; r.Set(sx, sy, chara_width * 3, chara_height * 4); SetSpriteRect(r); } } } if (tile_id == 0) { int row = character->GetDirection(); r.Set(character->GetPattern() * chara_width, row * chara_height, chara_width, chara_height); SetSrcRect(r); } if (character->IsFlashPending()) { Color col; int dur; character->GetFlashParameters(col, dur); Flash(col, dur); } SetVisible(character->GetVisible()); if (GetVisible()) { SetOpacity(character->GetOpacity()); } SetX(character->GetScreenX()); SetY(character->GetScreenY()); SetZ(character->GetScreenZ(chara_height)); //SetBlendType(character->GetBlendType()); //SetBushDepth(character->GetBushDepth()); }
void Sprite_Character::Update() { Sprite::Update(); Rect r; if (tile_id != character->GetTileId() || character_name != character->GetSpriteName() || character_index != character->GetSpriteIndex()) { tile_id = character->GetTileId(); character_name = character->GetSpriteName(); character_index = character->GetSpriteIndex(); if (tile_id > 0) { BitmapRef tile = Cache::Tile(Game_Map::GetChipsetName(), tile_id); SetBitmap(tile); r.Set(0, 0, TILE_SIZE, TILE_SIZE); SetSrcRect(r); SetOx(8); SetOy(16); } else { if (character_name.empty()) { SetBitmap(BitmapRef()); } else { SetBitmap(Cache::Charset(character_name)); SetOx(chara_width / 2); SetOy(chara_height); int sx = (character_index % 4) * chara_width * 3; int sy = (character_index / 4) * chara_height * 4; r.Set(sx, sy, chara_width * 3, chara_height * 4); SetSpriteRect(r); } } } if (tile_id == 0) { int row = (character->IsSpinning() ? character->GetPrelockDirection() : character->GetDirection()); r.Set(character->GetPattern() * chara_width, row * chara_height, chara_width, chara_height); SetSrcRect(r); } if (character->IsFlashPending()) { Color col = character->GetFlashColor(); int dur = character->GetFlashTimeLeft(); Flash(col, dur); // TODO: Gradual decrease of Flash Time Left character->SetFlashTimeLeft(0); } SetVisible(character->GetVisible()); if (GetVisible()) { SetOpacity(character->GetOpacity()); } SetX(character->GetScreenX()); SetY(character->GetScreenY()); SetZ(character->GetScreenZ(chara_height)); //SetBlendType(character->GetBlendType()); //SetBushDepth(character->GetBushDepth()); }
int CHeaderCtrlExt::GetVisibleItemCount() { int nVisible = 0; int nCount = GetItemCount(); for(int i = 0;i < nCount;++i) if(GetVisible(i))nVisible++; return nVisible; }
void CRenderableAnimatedInstanceModel::Render(CRenderManager *RM) { if(GetVisible()) { Mat44f l_Transform = GetTransform(); RM->SetTransform(l_Transform); m_AnimatedInstanceModel->Render(RM); } }
void Sprite_Character::Update() { Sprite::Update(); Rect r; if (tile_id != character->GetTileId() || character_name != character->GetSpriteName() || character_index != character->GetSpriteIndex()) { tile_id = character->GetTileId(); character_name = character->GetSpriteName(); character_index = character->GetSpriteIndex(); if (tile_id > 0) { if (tile_request) { tile_request->Unbind(tile_request_id); } tile_request = AsyncHandler::RequestFile("ChipSet", Game_Map::GetChipsetName()); tile_request_id = tile_request->Bind(&Sprite_Character::OnTileSpriteReady, this); tile_request->Start(); } else { if (character_name.empty()) { SetBitmap(BitmapRef()); } else { if (char_request) { char_request->Unbind(char_request_id); } char_request = AsyncHandler::RequestFile("CharSet", character_name); char_request_id = char_request->Bind(&Sprite_Character::OnCharSpriteReady, this); char_request->Start(); } } } if (tile_id == 0) { int row = character->GetSpriteDirection(); r.Set(character->GetPattern() * chara_width, row * chara_height, chara_width, chara_height); SetSrcRect(r); } if (character->IsFlashPending()) { Color col = character->GetFlashColor(); int dur = character->GetFlashTimeLeft(); Flash(col, dur); // TODO: Gradual decrease of Flash Time Left character->SetFlashTimeLeft(0); } SetVisible(character->GetVisible()); if (GetVisible()) { SetOpacity(character->GetOpacity()); } SetX(character->GetScreenX()); SetY(character->GetScreenY()); SetZ(character->GetScreenZ()); //SetBlendType(character->GetBlendType()); int bush_split = 4 - character->GetBushDepth(); SetBushDepth(bush_split > 3 ? 0 : GetHeight() / bush_split); }
void avtText2DColleague::Hide() { SetVisible(!GetVisible()); if(addedToRenderer) RemoveFromRenderer(); else AddToRenderer(); }
void avtLegendAttributesColleague::GetOptions(AnnotationObject &annot) { annot = atts; // Make sure that the name is set properly. annot.SetObjectType(AnnotationObject::LegendAttributes); annot.SetVisible(GetVisible()); annot.SetActive(GetActive()); }
// 获取控件的可见性(遍历父控件,如果父控件不可见,则返回不可见) BOOL CControlBase::IsControlVisible() { if(!GetVisible()) { return FALSE; } CDuiObject* pParentObj = GetParent(); if(pParentObj == NULL) { return GetVisible(); } if(pParentObj->IsClass("dlg") || pParentObj->IsClass("popup")) { return GetVisible(); } return ((CControlBase*)pParentObj)->IsControlVisible(); }
bool TrackBar::OnEventKeyboard(Event event,WPARAM wparam,LPARAM lparam) { if(!GetVisible() || !GetEnabled()) return false; switch(event) { case EventKeyDown: if(wparam == VK_DOWN || wparam == VK_LEFT) { if(GetTrackValue()) SetTrackValue(GetTrackValue() - 1); if(GetParent()) GetParent()->OnEvent(EventChildCommand,ControlEventTrackChange,(LPARAM)this); return true; } if(wparam == VK_UP || wparam == VK_RIGHT) { if(GetTrackValue() < GetTrackRange()) SetTrackValue(GetTrackValue() + 1); if(GetParent()) GetParent()->OnEvent(EventChildCommand,ControlEventTrackChange,(LPARAM)this); return true; } if(wparam == VK_HOME) { SetTrackValue(0); if(GetParent()) GetParent()->OnEvent(EventChildCommand,ControlEventTrackChange,(LPARAM)this); return true; } if(wparam == VK_END) { SetTrackValue(GetTrackRange()); if(GetParent()) GetParent()->OnEvent(EventChildCommand,ControlEventTrackChange,(LPARAM)this); return true; } break; } return Control::OnEventKeyboard(event,wparam,lparam); }
bool TrackBar::OnRender(void) { if(!GetVisible()) return false; Rect box = GetBoundingBox(); GetKernel()->GetUserInterface()->DrawTrackBar(box,GetTrackBox(),GetTrackRange(),GetTrackValue(),false,GetEnabled(),GetFocused()); return Control::OnRender(); }
ControlHandle Control::GetChildAtPoint(const Point& point) { for(unsigned long i = 0; i < mChilds.GetSize(); ++i) if(mChilds[i]->PointIn(point) && mChilds[i]->GetEnabled() && mChilds[i]->GetVisible()) return mChilds[i]; if(PointIn(point) && GetEnabled() && GetVisible()) return this; return NULL; }
bool DiInstancedModel::FindVisible( DiCamera *camera ) const { bool retVal = GetVisible(); float r = DiMath::BoundingRadiusFromAABB(GetBoundingBox()); if( retVal && camera ) { retVal = camera->IsVisible(DiSphere(GetDerivedPosition(),r)); } return retVal; }
/** * \param evt Event that occured * \param *wparam Any kind of value that needs to be passed on to the function. * (For example if a structure needs to be passed.) * \param lparam Numeric value that needed to be passed for event processing. * \param *returnvalue Return value, if any, will be stored here. * If NULL, no return value shall be stored. * \return Boolean value specifying if the event was processed at all. True * means an event was caught by the widget, or by a child. * * Unlike other UI libraries, this library has one philosophy and that is * it does not like hooking to any of the windowing system's functions; * it does not depend upon either GLUT, Windows, Linux or MacOS. Widgets * are receiving user feedback upon being told that user made some. They * are told this by the program that uses this library. Example of this * action is that in, let's say, GLUT the program receives a call to mouse() * function. Upon this, the program casts an event using this function to * the widget which then processes what should actually happen. * A button, for example, would upon a mouseclick call to OnClick function. * * The thing is, this CastEvent function first tries to tell its children that * the event happened, and upon being told by each of them that they didn't * do anything with the event, goes on with processing it itself. * * Container class does not do anything except pushing events on to * DefaultCastEvent. * * \sa DefaultCastEvent() */ bool glictContainer::CastEvent(glictEvents evt, void* wparam, long lparam, void* returnvalue) { if (!GetVisible() || !GetEnabled()) return false; //printf("Event of type %s passing through %s (%s)\n", EvtTypeDescriptor(evt), objtype, parent ? parent->objtype : "NULL"); switch (evt) { default: return DefaultCastEvent(evt, wparam, lparam, returnvalue); // use default processing for all events case GLICT_MOUSECLICK: return DefaultCastEvent(evt, wparam, lparam, returnvalue); // we never catch a mouse click in glictContainer... but some child might do so break; } }
HRESULT CXChildWnd::SetParentVisible(BOOL bVisible) { __super::SetParentVisible(bVisible); if(GetVisible()) { ShowWindow(GetChildHwnd(),SW_SHOW); } else { ShowWindow(GetChildHwnd(),SW_HIDE); } return S_OK; }
void CInstanceMesh::Render(CRenderManager *RM) { if(GetVisible()) { /*OJUCUIDAO*/ //Exportem els vertex dels objectes en un espai real, per tant si els transformem amb pos rot i scale es lia //Exportamos los vertices de los objetos en espacio real, asi que al aplicarles la transformada con pos rot y scale, se lia parda //RM->GetContextManager()->SetWorldMatrix(GetTransform()); Mat44f world; world.SetIdentity(); RM->GetContextManager()->SetWorldMatrix(world); m_StaticMesh->Render(RM); } }
void CDialogBox::Update () { if (GetVisible() && CGuiElement::m_bIsActive) { // Math::Vect2i posMouse; // InputManagerInstance->GetPosition(IDV_MOUSE, posMouse); // if( m_bDialogClicked ) // { // if (!InputManagerInstance->IsDown(IDV_MOUSE, MOUSE_BUTTON_LEFT)) // { // m_bDialogClicked = false; // m_bStart_to_Move = false; // } // else // { // if( !m_bStart_to_Move ) // { // m_bStart_to_Move = true; // m_PreviousPosMouse = posMouse; // } // else // { // Math::Vect2i incPos = posMouse - m_PreviousPosMouse; // m_PreviousPosMouse = posMouse; // //m_ButtonMove.SetPosition( m_ButtonMove.GetPosition() + incPos ); // m_ButtonClose.SetPosition( m_ButtonClose.GetPosition() + incPos ); // SetPosition( GetPosition() + incPos); // } // } // } // CGuiElement::CalculatePosMouse(posMouse); // if (CGuiElement::IsInside()) // { // if (InputManagerInstance->IsDown(IDV_KEYBOARD, 0)) // { // CGuiElement::m_bFocus = true; // } // } // m_ButtonClose.Update(); // //m_ButtonMove.Update(); // CGuiElement::CalculatePosMouse(posMouse); ///* if( m_ButtonMove.IsClicking() ) // { // m_bDialogClicked = true; // }*/ }// End if( GuiElement::mIsVisible && GuiElement::mIsActive ) }
// 设置控件的焦点 BOOL CCheckButton::SetControlFocus(BOOL bFocus) { __super::SetControlFocus(bFocus); if(!GetVisible() || GetDisable()) { return FALSE; } m_bIsFocus = bFocus; UpdateControl(true); return TRUE; }
UIStaticText *UIButton::CreateTextForState(eButtonDrawState buttonState) { if(stateTexts[buttonState]) { return stateTexts[buttonState]; } stateTexts[buttonState] = new UIStaticText(Rect(0, 0, size.x, size.y)); if(!GetVisible()) { stateTexts[buttonState]->SetVisible(false, false); } return stateTexts[buttonState]; }
bool Control::PointIn(const Point& point) const { if(!GetVisible()) return false; Point position = GetScreenPosition(); if(point.x < position.x || point.x > position.x + mSize.cx) return false; if(point.y < position.y || point.y > position.y + mSize.cy) return false; return true; }
size_t DiInstancedModel::GetTransforms( DiMat4 *xform ) const { size_t retVal = 1; if( GetVisible() ) { if( !mSkeletonInstance ) { *xform = mBatchOwner->UseBoneWorldMatrices() ? GetParentNodeFullTransform() : DiMat4::IDENTITY; } else { DiMat4* matrices = mBatchOwner->UseBoneWorldMatrices() ? mBoneWorldMatrices : mBoneMatrices; size_t bones = mSkeletonInstance->GetNumBones(); for (size_t b=0; b <bones;) { *xform++ = matrices[b++]; } // const DiSubMesh::IndexMap *indexMap = m_pkBatchOwner->GetIndexToBoneMap(); // DiSubMesh::IndexMap::const_iterator itor = indexMap->begin(); // DiSubMesh::IndexMap::const_iterator end = indexMap->end(); // // while( itor != end ) // { // *xform++ = matrices[*itor++]; // } retVal = bones;//indexMap->size(); } } else { if( mSkeletonInstance ) { retVal = mBatchOwner->GetIndexToBoneMap()->size(); } for (size_t i = 0; i < retVal; i++) { xform[i] = DiMat4::ZEROAFFINE; } } return retVal; }
// Render the graphics pEntity. This attaches all resource objects of the graphics entity to // the scene. The method should only be called if the graphics object is actually visible! void CShapeEntity::Render() { if (!GetVisible()) return; ValidateResource(); UpdateRenderContextVariables(); RenderCtx.SetFrameId(GfxSrv->GetFrameID()); RenderCtx.SetGlobalBox(GetShadowBox()); RenderRenderContext(RenderCtx); if (ShadowResource.IsLoaded()) //???if (ShadowRenderCtx.IsValid())? { ShadowRenderCtx.SetGlobalBox(RenderCtx.GetGlobalBox()); RenderRenderContext(ShadowRenderCtx); } }