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


C++ ModelCache类代码示例

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


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

示例1: ModelCache_insert

static ModelCache::iterator ModelCache_insert (const std::string& path, const std::string& name, scene::Node& node)
{
    if (g_modelCache_enabled) {
        return g_modelCache.insert(ModelKey(path, name), NodeSmartReference(node));
    }
    return g_modelCache.insert(ModelKey("", ""), g_nullModel);
}
开发者ID:kevlund,项目名称:ufoai,代码行数:7,代码来源:referencecache.cpp

示例2: ModelCache_find

static ModelCache::iterator ModelCache_find (const std::string& path, const std::string& name)
{
    if (g_modelCache_enabled) {
        return g_modelCache.find(ModelKey(path, name));
    }
    return g_modelCache.end();
}
开发者ID:kevlund,项目名称:ufoai,代码行数:7,代码来源:referencecache.cpp

示例3: ModelCache_find

ModelCache::iterator ModelCache_find(const char* path, const char* name)
{
  if(g_modelCache_enabled)
  {
    return g_modelCache.find(ModelKey(path, name));
  }
  return g_modelCache.end();
}
开发者ID:clbr,项目名称:netradiant,代码行数:8,代码来源:referencecache.cpp

示例4: ModelCache_flush

void ModelCache_flush (const std::string& path, const std::string& name)
{
    ModelCache::iterator i = g_modelCache.find(ModelKey(path, name));
    if (i != g_modelCache.end()) {
        //ASSERT_MESSAGE((*i).value.getCount() == 0, "resource flushed while still in use: " << (*i).key.first.c_str() << (*i).key.second.c_str());
        g_modelCache.erase(i);
    }
}
开发者ID:kevlund,项目名称:ufoai,代码行数:8,代码来源:referencecache.cpp

示例5: setNode

    void setNode (scene::Node* node)
    {
        ModelCache::iterator i = ModelCache_find(m_path, m_name);
        if (i != g_modelCache.end()) {
            (*i).value = NodeSmartReference(*node);
        }
        setModel(NodeSmartReference(*node));

        connectMap();
    }
开发者ID:kevlund,项目名称:ufoai,代码行数:10,代码来源:referencecache.cpp

示例6: ModelWrapper

  ModelWrapper(entity_interfaces_t* model, const char* name)
    : m_refcount(1), m_name(name)
  {
    m_model = g_model_cache.capture(ModelCache::key_type(m_name.GetBuffer(), 0));

    model->pRender = this;
    model->pRender->IncRef();
    model->pEdit = NULL;
    model->pSelect = this;
    model->pSelect->IncRef();
  }
开发者ID:AEonZR,项目名称:GtkRadiant,代码行数:11,代码来源:remap.cpp

示例7: loadCached

    void loadCached ()
    {
        if (g_modelCache_enabled) {
            // cache lookup
            ModelCache::iterator i = ModelCache_find(m_path, m_name);
            if (i == g_modelCache.end()) {
                i = ModelCache_insert(m_path, m_name, Model_load(m_loader, m_path, m_name, m_type));
            }

            setModel((*i).value);
        } else {
            setModel(Model_load(m_loader, m_path, m_name, m_type));
        }
    }
开发者ID:kevlund,项目名称:ufoai,代码行数:14,代码来源:referencecache.cpp

示例8: RemapWrapper

  RemapWrapper(entity_interfaces_t* model, const char* name)
    : m_refcount(1)
  {
    parse_namestr(name);

    m_model = g_model_cache.capture(ModelCache::key_type(m_name.GetBuffer(), m_frame));

    model->pRender = this;
    model->pRender->IncRef();
    model->pEdit = NULL;
    model->pSelect = this;
    model->pSelect->IncRef();

    construct_shaders();
  }
开发者ID:AEonZR,项目名称:GtkRadiant,代码行数:15,代码来源:remap.cpp

示例9:

  virtual ~RemapWrapper()
  {
    g_model_cache.release(ModelCache::key_type(m_name.GetBuffer(), m_frame));

    for(shaders_t::iterator i = m_shaders.begin(); i != m_shaders.end(); ++i) {
      (*i)->DecRef();
	}

    for(remaps_t::iterator j = m_remaps.begin(); j != m_remaps.end(); ++j)
    {
      remap_t *pRemap = (*j);
      delete pRemap;
    }
    m_remaps.clear();
  }
开发者ID:AEonZR,项目名称:GtkRadiant,代码行数:15,代码来源:remap.cpp

示例10: ModelCache_clear

void ModelCache_clear()
{
  g_modelCache_enabled = false;
  g_modelCache.clear();
  g_modelCache_enabled = true;
}
开发者ID:clbr,项目名称:netradiant,代码行数:6,代码来源:referencecache.cpp


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