当前位置: 首页>>代码示例>>C++>>正文


C++ BinTree::DisposeAll方法代码示例

本文整理汇总了C++中BinTree::DisposeAll方法的典型用法代码示例。如果您正苦于以下问题:C++ BinTree::DisposeAll方法的具体用法?C++ BinTree::DisposeAll怎么用?C++ BinTree::DisposeAll使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BinTree的用法示例。


在下文中一共展示了BinTree::DisposeAll方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: DeleteAll

  //
  // Delete all cursors
  //
  void DeleteAll()
  {
    ASSERT(sysInit);

    // Unset the current cursor
    current = NULL;

    // Clear standard cursors
    for (int i = 0; i < MAX_CURSORS; i++)
    {
      standardCrs[i] = 0;
    }

    // Delete all cursors
    cursors.DisposeAll();
  }
开发者ID:ZhouWeikuan,项目名称:darkreign2,代码行数:19,代码来源:cursor.cpp

示例2: Done

    ///////////////////////////////////////////////////////////////////////////////
    //
    // Quake::Done
    //
    void Done()
    {
      if (!soundoff)
      {
        effect->StopByEffect(); 
        soundoff = TRUE;
      }
      if (effect)
      {
        delete effect;
      }

      typeList.DisposeAll();

      VarSys::DeleteItem("quake");

      sysInit = FALSE;
    }
开发者ID:vgck,项目名称:opendr2,代码行数:22,代码来源:environment_quake.cpp

示例3: DrawSelf

    //
    // DrawSelf
    //
    // Redraw self
    //
    void Color::DrawSelf(PaintInfo &pi)
    {
      IControl::DrawSelf(pi);

      // Get the color for the current color
      const PlayerInfo *playerInfo;
      Data::Get(&playerInfo, Network::GetCurrentPlayer().GetId());
      ASSERT(playerInfo);
      ASSERT(teamId < Game::MAX_TEAMS);

      const Team *team;
      Data::Get(&team, teamId);
      ASSERT(team);

      // Update the current color
      colorCurrent->SetIntegerValue(team->color);

      // Figure out which colors are available
      BinTree<GroupTree> groups;
      BuildPlayerHierachy(groups);
      Bool colors[Game::MAX_TEAMS + 1];

      for (U32 t = 0; t <= Game::MAX_TEAMS; t++)
      {
        colors[t] = FALSE;
      }
      for (BinTree<GroupTree>::Iterator gti(&groups); *gti; gti++)
      {
        for (BinTree<TeamTree>::Iterator tti(&(*gti)->teams); *tti; tti++)
        {
          colors[(*tti)->team->color] = TRUE;
        }
      }
      groups.DisposeAll();

      /*
      // Is the currently selected color still available ?
      if (colors[colorSelected->GetIntegerValue()])
      {
        colorSelected->SetIntegerValue(team->color);
      }
      */

      // Display all of the available colors
      for (t = 0; t <= Game::MAX_TEAMS; t++)
      {
        // Is the color available ?
        if (!colors[t] || t == team->color)
        {
          Point<S32> p(t * pi.client.Height(), 0);

          // Draw the team color
          ClipRect c(
            pi.client.p0.x + p.x + 3, 
            pi.client.p0.y + p.y + 3, 
            pi.client.p0.x + p.x + pi.client.Height() - 3, 
            pi.client.p0.y + p.y + pi.client.Height() - 3);

          IFace::RenderShadow(
            c, 
            c + IFace::GetMetric(IFace::DROPSHADOW_UP), 
            ::Color(0, 0, 0, IFace::GetMetric(IFace::SHADOW_ALPHA)), 
            0);

          IFace::RenderGradient(c, GetTeamColor(t), 150);

          // Is this the selected color ?
          if (t == U32(colorSelected->GetIntegerValue()))
          {
            IFace::RenderGradient(
              ClipRect(
                pi.client.p0.x + p.x + 1, 
                pi.client.p0.y + p.y + 1, 
                pi.client.p0.x + p.x + pi.client.Height() - 1, 
                pi.client.p0.y + p.y + pi.client.Height() - 1),
              ::Color(1.0f, 1.0f, 1.0f, 0.4f), 
              ::Color(0.5f, 0.5f, 0.5f, 0.4f));
          }
          // Is this the current color ?
          else if (t == team->color)
          {
            IFace::RenderGradient(
              ClipRect(
                pi.client.p0.x + p.x + 1, 
                pi.client.p0.y + p.y + 1, 
                pi.client.p0.x + p.x + pi.client.Height() - 1, 
                pi.client.p0.y + p.y + pi.client.Height() - 1),
              ::Color(1.0f, 1.0f, 1.0f, 0.15f),
              ::Color(0.5f, 0.5f, 0.5f, 0.15f));
          }
        }
      }
    }
开发者ID:ZhouWeikuan,项目名称:darkreign2,代码行数:98,代码来源:multiplayer_controls_color.cpp


注:本文中的BinTree::DisposeAll方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。