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


C++ CTexture::size方法代码示例

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


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

示例1: AllocResources

void CGUITextureBase::AllocResources()
{
  if (m_info.filename.IsEmpty())
    return;

  if (m_texture.size())
    return; // already have our texture

  // reset our animstate
  m_frameCounter = 0;
  m_currentFrame = 0;
  m_currentLoop = 0;

  if (m_info.useLarge)
  { // we want to use the large image loader, but we first check for bundled textures
    if (!IsAllocated())
    {
      int images = g_TextureManager.Load(m_info.filename, true);
      if (images)
      {
        m_isAllocated = NORMAL;
        m_texture = g_TextureManager.GetTexture(m_info.filename);
      }
    }
    if (m_isAllocated != NORMAL)
    { // use our large image background loader
      CTexture texture = g_largeTextureManager.GetImage(m_info.filename, m_largeOrientation, !IsAllocated());
      m_isAllocated = LARGE;

      if (!texture.size()) // not ready as yet
        return;

      m_texture = texture;
    }
  }
  else
  {
    int images = g_TextureManager.Load(m_info.filename);

    // set allocated to true even if we couldn't load the image to save
    // us hitting the disk every frame
    m_isAllocated = NORMAL;
    if (!images)
      return;

    m_texture = g_TextureManager.GetTexture(m_info.filename);
  }
  m_frameWidth = (float)m_texture.m_width;
  m_frameHeight = (float)m_texture.m_height;

  // load the diffuse texture (if necessary)
  if (!m_info.diffuse.IsEmpty())
  {
    g_TextureManager.Load(m_info.diffuse);
    m_diffuse = g_TextureManager.GetTexture(m_info.diffuse);
  }

  CalculateSize();

  // call our implementation
  Allocate();
}
开发者ID:derobert,项目名称:debianlink-xbmc,代码行数:62,代码来源:GUITexture.cpp


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