本文整理汇总了C++中FindRes函数的典型用法代码示例。如果您正苦于以下问题:C++ FindRes函数的具体用法?C++ FindRes怎么用?C++ FindRes使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了FindRes函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetTexture
HTEXTURE hgeResourceManager::GetTexture(const char *name, int resgroup)
{
HTEXTURE reshandle;
RTexture *resource;
ResDesc *Res=FindRes(this, RES_TEXTURE, name);
if(Res) return (HTEXTURE)Res->Get(this);
else
{
reshandle=hge->Texture_Load(name);
if(reshandle)
{
resource=new RTexture();
resource->handle=reshandle;
resource->resgroup=resgroup;
resource->mipmap=false;
strcpy(resource->name, name);
strcpy(resource->filename, name);
AddRes(this, RES_TEXTURE, resource);
return reshandle;
}
}
return 0;
}
示例2: RAnimation
void RAnimation::Parse(hgeResourceManager *rm, RScriptParser *sp, const char *name, const char *basename)
{
RAnimation *rc, *base;
rc = new RAnimation();
base = (RAnimation *)FindRes(rm, RES_ANIMATION, basename);
if(base) *rc=*base;
else
{
rc->resgroup=0;
rc->texname[0]=0;
rc->tx=rc->ty=0;
rc->w=rc->h=0;
rc->hotx=rc->hoty=0;
rc->blend=BLEND_COLORMUL | BLEND_ALPHABLEND | BLEND_NOZWRITE;
rc->color=0xFFFFFFFF;
rc->z=0.5f;
rc->bXFlip=false;
rc->bYFlip=false;
// rc->x=rc->y=0;
// rc->scale=1.0f;
// rc->rotation=0.0f;
// rc->collision=HGECOL_RECT;
rc->frames=1;
rc->fps=12.0f;
rc->mode=HGEANIM_FWD | HGEANIM_LOOP;
}
rc->handle=0;
strcpy(rc->name, name);
ScriptParseSpriteAnim(sp, rc, true);
AddRes(rm, RES_ANIMATION, rc);
}
示例3: GetResource
VOID* hgeResourceManager::GetResource(CONST TCHAR *name, INT resgroup)
{
VOID *reshandle;
RResource *resource;
ResDesc *Res=FindRes(this, RES_RESOURCE, name);
if(Res) return (VOID *)Res->Get(this);
else
{
reshandle=hge->Resource_Load(name);
if(reshandle)
{
resource=new RResource();
resource->handle=(DWORD)reshandle;
resource->resgroup=resgroup;
_tcscpy(resource->name, name);
_tcscpy(resource->filename, name);
AddRes(this, RES_RESOURCE, resource);
return reshandle;
}
}
return 0;
}
示例4: GetResource
void* hgeResourceManager::GetResource(const char *name, int resgroup)
{
void *reshandle;
RResource *resource;
ResDesc *Res=FindRes(this, RES_RESOURCE, name);
if(Res) return (void *)Res->Get(this);
else
{
reshandle=hge->Resource_Load(name);
if(reshandle)
{
resource=new RResource();
resource->handle=(DWORD)reshandle;
resource->resgroup=resgroup;
strcpy(resource->name, name);
strcpy(resource->filename, name);
AddRes(this, RES_RESOURCE, resource);
return reshandle;
}
}
return 0;
}
示例5: RSprite
void RSprite::Parse(hgeResourceManager *rm, RScriptParser *sp, const char *name, const char *basename)
{
RSprite *rc, *base;
rc = new RSprite();
base = (RSprite *)FindRes(rm, RES_SPRITE, basename);
if(base) *rc=*base;
else
{
rc->resgroup=0;
rc->texname[0]=0;
rc->tx=rc->ty=0;
rc->w=rc->h=0;
rc->hotx=rc->hoty=0;
rc->blend=BLEND_COLORMUL | BLEND_ALPHABLEND | BLEND_NOZWRITE;
rc->color=0xFFFFFFFF;
rc->z=0.5f;
rc->bXFlip=false;
rc->bYFlip=false;
// rc->x=rc->y=0;
// rc->scale=1.0f;
// rc->rotation=0.0f;
// rc->collision=HGECOL_RECT;
}
rc->handle=0;
strcpy(rc->name, name);
ScriptParseSpriteAnim(sp, rc, false);
AddRes(rm, RES_SPRITE, rc);
}
示例6: GetTexture
HTEXTURE hgeResourceManager::GetTexture(CONST TCHAR *name, INT resgroup)
{
HTEXTURE reshandle;
RTexture *resource;
ResDesc *Res=FindRes(this, RES_TEXTURE, name);
if(Res) return (HTEXTURE)Res->Get(this);
else
{
reshandle=hge->Texture_Load(name);
if(reshandle)
{
resource=new RTexture();
resource->handle=reshandle;
resource->resgroup=resgroup;
resource->mipmap=FALSE;
_tcscpy(resource->name, name);
_tcscpy(resource->filename, name);
AddRes(this, RES_TEXTURE, resource);
return reshandle;
}
}
return 0;
}
示例7: ScriptParseFileResource
void ScriptParseFileResource(hgeResourceManager *rm, RScriptParser *sp, const char *name, const char *basename, ResDesc *rr, int restype)
{
RResource *rc=(RResource *)rr, *base;
base = (RResource *)FindRes(rm, restype, basename);
if(base) *rc=*base; else
{
rc->resgroup=0;
rc->filename[0]=0;
}
rc->handle=0; strcpy(rc->name, name);
while(ScriptSkipToNextParameter(sp,false))
{
switch(sp->tokentype)
{
case TTPAR_FILENAME:
sp->get_token(); sp->get_token();
strcpy(rc->filename, sp->tkn_string());
break;
case TTPAR_RESGROUP:
sp->get_token(); sp->get_token();
rc->resgroup=sp->tkn_int();
break;
default:
ScriptSkipToNextParameter(sp,true);
break;
}
}
AddRes(rm, restype, rc);
}
示例8: FindRes
hgeDistortionMesh *hgeResourceManager::GetDistortionMesh(const char *name)
{
ResDesc *Res = FindRes(this, RES_DISTORT, name);
if (Res) {
return (hgeDistortionMesh *)Res->Get(this);
} else {
return 0;
}
}
示例9: RMusic
void RMusic::Parse(hgeResourceManager *rm, RScriptParser *sp, const char *name, const char *basename)
{
// ScriptParseFileResource(rm, sp, name, basename, new RMusic(), RES_MUSIC);
RMusic *rc, *base;
rc=new RMusic();
base = (RMusic *)FindRes(rm, RES_MUSIC, basename);
if(base) *rc=*base;
else
{
rc->resgroup=0;
rc->amplify=50;
}
rc->handle=0; strcpy(rc->name, name);
while(ScriptSkipToNextParameter(sp,false))
{
switch(sp->tokentype)
{
case TTPAR_FILENAME:
sp->get_token(); sp->get_token();
strcpy(rc->filename, sp->tkn_string());
break;
case TTPAR_RESGROUP:
sp->get_token(); sp->get_token();
rc->resgroup=sp->tkn_int();
break;
case TTPAR_AMPLIFY:
sp->get_token(); sp->get_token();
rc->amplify=sp->tkn_int();
break;
default:
ScriptSkipToNextParameter(sp,true);
break;
}
}
AddRes(rm, RES_MUSIC, rc);
}
示例10: RTarget
void RTarget::Parse(hgeResourceManager *rm, RScriptParser *sp, const char *name, const char *basename)
{
RTarget *rc, *base;
rc = new RTarget();
base = (RTarget *)FindRes(rm, RES_TARGET, basename);
if(base) *rc=*base;
else
{
rc->resgroup=0;
rc->width=256;
rc->height=256;
rc->zbuffer=false;
}
rc->handle=0; strcpy(rc->name, name);
while(ScriptSkipToNextParameter(sp, false))
{
switch(sp->tokentype)
{
case TTPAR_SIZE:
sp->get_token(); sp->get_token();
rc->width=sp->tkn_int();
sp->get_token();
sp->get_token();
rc->height=sp->tkn_int();
break;
case TTPAR_ZBUFFER:
sp->get_token(); sp->get_token();
rc->zbuffer=sp->tkn_bool();
break;
case TTPAR_RESGROUP:
sp->get_token(); sp->get_token();
rc->resgroup=sp->tkn_int();
break;
default:
ScriptSkipToNextParameter(sp, true);
break;
}
}
AddRes(rm, RES_TARGET, rc);
}
示例11: FindRes
unsigned char *CNwnKeyFile::LoadRes (const char *pszName,
NwnResType nResType, UINT32 *pulSize, bool *pfAllocated)
{
//
// Find the resource
//
const Resource *psRes = FindRes (pszName, nResType);
if (psRes == NULL)
return NULL;
//
// Invoke the helper
//
return LoadRes (psRes, pulSize, pfAllocated);
}
示例12: RParticle
void RParticle::Parse(hgeResourceManager *rm, RScriptParser *sp, const char *name, const char *basename)
{
RParticle *rc, *base;
rc = new RParticle();
base = (RParticle *)FindRes(rm, RES_PARTICLE, basename);
if(base) *rc=*base;
else
{
rc->resgroup=0;
rc->filename[0]=0;
rc->spritename[0]=0;
}
rc->handle=0; strcpy(rc->name, name);
while(ScriptSkipToNextParameter(sp, false))
{
switch(sp->tokentype)
{
case TTPAR_FILENAME:
sp->get_token(); sp->get_token();
strcpy(rc->filename, sp->tkn_string());
break;
case TTPAR_SPRITE:
sp->get_token(); sp->get_token();
strcpy(rc->spritename, sp->tkn_string());
break;
case TTPAR_RESGROUP:
sp->get_token(); sp->get_token();
rc->resgroup=sp->tkn_int();
break;
default:
ScriptSkipToNextParameter(sp, true);
break;
}
}
AddRes(rm, RES_PARTICLE, rc);
}
示例13: RTexture
void RTexture::Parse(hgeResourceManager *rm, RScriptParser *sp, const char *name, const char *basename)
{
RTexture *rc, *base;
rc=new RTexture();
base = (RTexture *)FindRes(rm, RES_TEXTURE, basename);
if(base) *rc=*base;
else
{
rc->resgroup=0;
rc->mipmap=false;
}
rc->handle=0; strcpy(rc->name, name);
while(ScriptSkipToNextParameter(sp,false))
{
switch(sp->tokentype)
{
case TTPAR_FILENAME:
sp->get_token(); sp->get_token();
strcpy(rc->filename, sp->tkn_string());
break;
case TTPAR_RESGROUP:
sp->get_token(); sp->get_token();
rc->resgroup=sp->tkn_int();
break;
case TTPAR_MIPMAP:
sp->get_token(); sp->get_token();
rc->mipmap=sp->tkn_bool();
break;
default:
ScriptSkipToNextParameter(sp,true);
break;
}
}
AddRes(rm, RES_TEXTURE, rc);
}
示例14: while
void CDlgSpeedTest::Sort()
{
CMap<DWORD,DWORD,SpeedTestResult,SpeedTestResult> mapTmp;
CArray<SpeedTestResult,SpeedTestResult> ayTmp;
for (int i=0; i<m_ayTestResult.GetCount(); i++)
{
SpeedTestResult res = m_ayTestResult.GetAt(i);
if (!res.m_bError)
{
mapTmp.SetAt(res.m_result,res);
}
else
ayTmp.Add(res);
}
m_ayTestResult.RemoveAll();
POSITION pos = mapTmp.GetStartPosition();
DWORD key;
SpeedTestResult val;
while (pos)
{
mapTmp.GetNextAssoc(pos,key,val);
m_ayTestResult.Add(val);
}
for (int j=0; j<ayTmp.GetCount(); j++)
{
m_ayTestResult.Add(ayTmp.GetAt(j));
}
for(int i=0; i<m_cList.GetItemCount(); i++)
{
CString str;
str = m_cList.GetItemText(i,0);
if (FindRes(str))
{
m_cList.DeleteItem(i);
i--;
}
}
ShowRes();
}
示例15: GetEffect
HEFFECT hgeResourceManager::GetEffect(CONST TCHAR *name, INT resgroup)
{
HEFFECT reshandle;
REffect *resource;
ResDesc *Res=FindRes(this, RES_EFFECT, name);
if(Res) return (HEFFECT)Res->Get(this);
else
{
reshandle=hge->Effect_Load(name);
if(reshandle)
{
resource=new REffect();
resource->handle=reshandle;
resource->resgroup=resgroup;
_tcscpy(resource->name, name);
_tcscpy(resource->filename, name);
AddRes(this, RES_EFFECT, resource);
return reshandle;
}
}
return 0;
}