コード例 #1
0
void GuiRolloutCtrl::onRender( Point2I offset, const RectI &updateRect )
{
   if( !mProfile || mProfile->mFont == NULL )
      return;

   // Calculate actual world bounds for rendering
   RectI worldBounds( offset, getExtent() );

   // if opaque, fill the update rect with the fill color
   if ( mProfile->mOpaque )
      GFX->getDrawUtil()->drawRectFill( worldBounds, mProfile->mFillColor );

   if ( mProfile->mBitmapArrayRects.size() >= NumBitmaps )
   {
      GFX->getDrawUtil()->clearBitmapModulation();

      // Draw Rollout From Skin
      if ( !mIsExpanded && !mIsAnimating )
         renderFixedBitmapBordersFilled( worldBounds, 1, mProfile );
      else if ( mHideHeader )
         renderSizableBitmapBordersFilledIndex( worldBounds, MidPageLeft, mProfile );
      else
         renderSizableBitmapBordersFilledIndex( worldBounds, TopLeftHeader, mProfile );
   }

   if ( !(mIsExpanded && mHideHeader ) )
   {
      // Draw Caption ( Vertically Centered )
      ColorI currColor;
      GFX->getDrawUtil()->getBitmapModulation( &currColor );
      Point2I textPosition = mHeader.point + offset + mProfile->mTextOffset;
      GFX->getDrawUtil()->setBitmapModulation( mProfile->mFontColor );
      renderJustifiedText( textPosition, mHeader.extent, mCaption );
      GFX->getDrawUtil()->setBitmapModulation( currColor );
   }

   // If we're collapsed we contain the first child as our content
   // thus we don't render it when collapsed.  but to support modified
   // rollouts with custom header buttons etc we still render our other
   // children. -JDD
   GuiControl *pChild = dynamic_cast<GuiControl*>( at(0) );
   if ( pChild )
   {
      if ( !mIsExpanded && !mIsAnimating && pChild->isVisible() )
	  {
         pChild->setVisible( false );
	  }
      else if ( (mIsExpanded || mIsAnimating) && !pChild->isVisible() )
	  {
         pChild->setVisible( true );
	  }
   }
   renderChildControls( offset, updateRect );

   // Render our border should we have it specified in our profile.
   renderBorder(worldBounds, mProfile);
}
コード例 #2
0
ファイル: terrCell.cpp プロジェクト: fr1tz/terminal-overload
void TerrCell::updateZoning( const SceneZoneSpaceManager *zoneManager )
{
   PROFILE_SCOPE( TerrCell_UpdateZoning );

   mZoneOverlap.setSize( zoneManager->getNumZones() );
   mZoneOverlap.clear();
   mIsInteriorOnly = true;

   if ( mChildren[0] == NULL )
   {
      Box3F worldBounds( mBounds );
      mTerrain->getTransform().mul( worldBounds );

      Vector<U32> zones;
      zoneManager->findZones( worldBounds, zones );

      for ( U32 i=0; i < zones.size(); i++ )
      {
         // Set overlap bit for zone except it's the outdoor zone.
         if( zones[ i ] != SceneZoneSpaceManager::RootZoneId )
            mZoneOverlap.set( zones[i] );
         else
            mIsInteriorOnly = false;
      }

      return;
   }

   for ( U32 i = 0; i < 4; i++ )
   {
      TerrCell *cell = mChildren[i];
      cell->updateZoning( zoneManager );
      mZoneOverlap.combineOR( cell->getZoneOverlap() );
      mIsInteriorOnly &= cell->mIsInteriorOnly;
   }
}