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


C++ hashtable::access方法代码示例

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


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

示例1:

model *loadmodel(const char *name, int i)
{
    if(!name)
    {
        if(!mapmodels.inrange(i)) return NULL;
        mapmodelinfo &mmi = mapmodels[i];
        if(mmi.m) return mmi.m;
        name = mmi.name;
    };
    model **mm = mdllookup.access(name);
    model *m;
    if(mm) m = *mm;
    else
    { 
        m = new md2(name);
        loadingmodel = m;
        if(!m->load())
        {
            delete m;
            m = new md3(name);
            loadingmodel = m;
            if(!m->load())
            {    
                delete m;
                loadingmodel = NULL;
                return NULL; 
            };
        };
        loadingmodel = NULL;
        mdllookup.access(m->name(), &m);
    };
    if(mapmodels.inrange(i) && !mapmodels[i].m) mapmodels[i].m = m;
    return m;
};
开发者ID:acidbarrel,项目名称:Torment,代码行数:34,代码来源:rendermodel.cpp

示例2: delmenu

void delmenu(const char *name)
{
    if (!name) return;
    gmenu *m = menus.access(name);
    if (!m) return;
    else menureset(m);
}
开发者ID:Fru5trum,项目名称:acr,代码行数:7,代码来源:menus.cpp

示例3: newfont

void newfont(char *name, char *tex, int *defaultw, int *defaulth, int *offsetx, int *offsety, int *offsetw, int *offseth)
{
    if(*defaulth < 10) return;          // (becomes FONTH)
    Texture *_tex = textureload(tex);
    if(_tex == notexture || !_tex->xs || !_tex->ys) return;
    font *f = fonts.access(name);
    if(!f)
    {
        name = newstring(name);
        f = &fonts[name];
        f->name = name;
    }

    f->tex = _tex;
    f->chars.shrink(0);
    f->defaultw = *defaultw;
    f->defaulth = *defaulth;
    f->offsetx = *offsetx;
    f->offsety = *offsety;
    f->offsetw = *offsetw;
    f->offseth = *offseth;
    f->skip = 33;

    fontdef = f;
}
开发者ID:assaultcube,项目名称:AC,代码行数:25,代码来源:rendertext.cpp

示例4: closemenu

void closemenu(const char *name)
{
    gmenu *m;
    if(!name)
    {
        if(curmenu) curmenu->close();
        while(!menustack.empty())
        {
            m = menustack.pop();
            if(m) m->close();
        }
        curmenu = NULL;
        return;
    }
    m = menus.access(name);
    if(!m) return;
    if(curmenu==m) menuset(menustack.empty() ? NULL : menustack.pop(), false);
    else loopv(menustack)
    {
        if(menustack[i]==m)
        {
            menustack.remove(i);
            return;
        }
    }
}
开发者ID:Fru5trum,项目名称:acr,代码行数:26,代码来源:menus.cpp

示例5: setfont

bool setfont(const char *name)
{
    font *f = fonts.access(name);
    if(!f) return false;
    curfont = f;
    return true;
}
开发者ID:t7g,项目名称:intensityengine,代码行数:7,代码来源:rendertext.cpp

示例6: findnormal

void findnormal(const vec &key, const vec &surface, vec &v)
{
    const nval *val = normalgroups.access(key);
    if(!val) { v = surface; return; }

    v = vec(0, 0, 0);
    int total = 0;
    if(surface.x >= lerpthreshold) { int n = (val->flat>>4)&0xF; v.x += n; total += n; }
开发者ID:christianleger,项目名称:OF-Engine,代码行数:8,代码来源:normal.cpp

示例7: newgui

void newgui(char *name, char *contents)
{
    if(guis.access(name))
    {
        delete[] guis[name];
        guis[name] = newstring(contents);
    }
    else guis[newstring(name)] = newstring(contents);
};
开发者ID:acidbarrel,项目名称:Torment,代码行数:9,代码来源:menus.cpp

示例8: chmenumdl

void chmenumdl(char *menu, char *mdl, char *anim, int *rotspeed, int *scale)
{
    if(!menu || !menus.access(menu)) return;
    gmenu &m = menus[menu];
    DELETEA(m.mdl);
    if(!mdl ||!*mdl) return;
    m.mdl = newstring(mdl);
    m.anim = findanim(anim)|ANIM_LOOP;
    m.rotspeed = clamp(*rotspeed, 0, 100);
    m.scale = clamp(*scale, 0, 100);
}
开发者ID:Fru5trum,项目名称:acr,代码行数:11,代码来源:menus.cpp

示例9: gui

 void gui(g3d_gui &g, bool firstpass)
 {
     if(guistack.empty()) return;
     char *name = guistack.last();
     char **contents = guis.access(name);
     if(!contents) return;
     cgui = &g;
     cgui->start(menustart, 0.03f, &menutab);
     guitab(name);
     execute(*contents);
     cgui->end();
     cgui = NULL;
 };
开发者ID:acidbarrel,项目名称:Torment,代码行数:13,代码来源:menus.cpp

示例10: destroyvbo

void destroyvbo(GLuint vbo)
{
    vboinfo *exists = vbos.access(vbo);
    if(!exists) return;
    vboinfo &vbi = *exists;
    if(vbi.uses <= 0) return;
    vbi.uses--;
    if(!vbi.uses)
    {
        glDeleteBuffers_(1, &vbo);
        if(vbi.data) delete[] vbi.data;
        vbos.remove(vbo);
    }
}
开发者ID:Infallible,项目名称:tess,代码行数:14,代码来源:octarender.cpp

示例11: setfont

bool setfont(const char *name)
{
    font *f = fonts.access(name);
    if(!f) return false;
    int v = -1;
    if(strcmp(name, "default")==0)
        v = 0;
    else if(strcmp(name, "serif")==0)
        v = 1;
    else if(strcmp(name, "mono")==0)
        v = 2;
    if(v!=-1) __fontsetting = v;
    curfont = f;
    return true;
}
开发者ID:acreloaded,项目名称:acr,代码行数:15,代码来源:rendertext.cpp

示例12: addauth

void addauth(char *name, char *flags, char *pubkey, char *email)
{
    string authname;
    if(filterstring(authname, name, true, true, true, true, 100)) name = authname;
    if(authusers.access(name))
    {
        conoutf("auth handle '%s' already exists, skipping (%s)", name, email);
        return;
    }
    name = newstring(name);
    authuser &u = authusers[name];
    u.name = name;
    u.flags = newstring(flags);
    u.pubkey = parsepubkey(pubkey);
    u.email = newstring(email);
}
开发者ID:jonathangray,项目名称:redeclipse-base,代码行数:16,代码来源:master.cpp

示例13: showgui

void showgui(char *name)
{
    int pos = guistack.find(name);
    if(pos<0)
    {
        if(!guis.access(name)) return;
        if(guistack.empty()) menupos = menuinfrontofplayer();
        guistack.add(newstring(name));
    }
    else
    {
        pos = guistack.length()-pos-1;
        loopi(pos) delete[] guistack.pop();
    };
    menutab = 1;
    menustart = lastmillis;
};
开发者ID:acidbarrel,项目名称:Torment,代码行数:17,代码来源:menus.cpp

示例14: showmenu

void showmenu(const char *name, bool top)
{
    if(!name)
    {
        curmenu = NULL;
        return;
    }
    gmenu *m = menus.access(name);
    if(!m) return;
    if(!top && curmenu)
    {
        if(curmenu==m) return;
        loopv(menustack) if(menustack[i]==m) return;
        menustack.insert(0, m);
        return;
    }
    menuset(m);
}
开发者ID:Fru5trum,项目名称:acr,代码行数:18,代码来源:menus.cpp

示例15: newfont

void newfont(char *name, char *tex, int *defaultw, int *defaulth, int *offsetx, int *offsety, int *offsetw, int *offseth)
{
    font *f = fonts.access(name);
    if(!f)
    {
        name = newstring(name);
        f = &fonts[name];
        f->name = name;
    }

    f->tex = textureload(tex);
    f->chars.setsize(0);
    f->defaultw = *defaultw;
    f->defaulth = *defaulth;
    f->offsetx = *offsetx;
    f->offsety = *offsety;
    f->offsetw = *offsetw;
    f->offseth = *offseth;

    fontdef = f;
}
开发者ID:Ajusa,项目名称:Sauerbraten,代码行数:21,代码来源:rendertext.cpp


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