本文整理汇总了C++中FindRes函数的典型用法代码示例。如果您正苦于以下问题:C++ FindRes函数的具体用法?C++ FindRes怎么用?C++ FindRes使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了FindRes函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:fg5823820,项目名称:HGEGameDemo1,代码行数:25,代码来源:hgeresource.cpp
示例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);
}
开发者ID:Sealina,项目名称:HgeProject,代码行数:34,代码来源:resources.cpp
示例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;
}
开发者ID:ueverything,项目名称:mmo-resourse,代码行数:25,代码来源:hgeresource.cpp
示例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;
}
开发者ID:fg5823820,项目名称:HGEGameDemo1,代码行数:25,代码来源:hgeresource.cpp
示例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);
}
开发者ID:Sealina,项目名称:HgeProject,代码行数:31,代码来源:resources.cpp
示例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;
}
开发者ID:ueverything,项目名称:mmo-resourse,代码行数:25,代码来源:hgeresource.cpp
示例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);
}
开发者ID:Sealina,项目名称:HgeProject,代码行数:34,代码来源:resources.cpp
示例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;
}
}
开发者ID:cafeinecake,项目名称:hge2,代码行数:10,代码来源:hgeresource.cpp
示例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);
}
开发者ID:Sealina,项目名称:HgeProject,代码行数:46,代码来源:resources.cpp
示例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);
}
开发者ID:Sealina,项目名称:HgeProject,代码行数:46,代码来源:resources.cpp
示例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);
}
开发者ID:deltreey,项目名称:NWNTools,代码行数:18,代码来源:NwnKeyFile.cpp
示例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);
}
开发者ID:Sealina,项目名称:HgeProject,代码行数:42,代码来源:resources.cpp
示例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);
}
开发者ID:Sealina,项目名称:HgeProject,代码行数:41,代码来源:resources.cpp
示例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();
}
开发者ID:hefen1,项目名称:XCaimi,代码行数:40,代码来源:DlgSpeedTest.cpp
示例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;
}
开发者ID:ueverything,项目名称:mmo-resourse,代码行数:24,代码来源:hgeresource.cpp
示例16: GetStream
HSTREAM hgeResourceManager::GetStream(CONST TCHAR *name, INT resgroup)
{
HSTREAM reshandle;
RStream *resource;
ResDesc *Res=FindRes(this, RES_STREAM, name);
if(Res) return (HSTREAM)Res->Get(this);
else
{
reshandle=hge->Stream_Load(name);
if(reshandle)
{
resource=new RStream();
resource->handle=reshandle;
resource->resgroup=resgroup;
_tcscpy(resource->name, name);
_tcscpy(resource->filename, name);
AddRes(this, RES_STREAM, resource);
return reshandle;
}
}
return 0;
}
开发者ID:ueverything,项目名称:mmo-resourse,代码行数:24,代码来源:hgeresource.cpp
示例17: GetStringTable
hgeStringTable* hgeResourceManager::GetStringTable(CONST TCHAR *name, INT resgroup)
{
hgeStringTable *strtable;
RStringTable *resource;
ResDesc *Res=FindRes(this, RES_STRTABLE, name);
if(Res) return (hgeStringTable*)Res->Get(this);
else
{
strtable=new hgeStringTable(name);
if(strtable)
{
resource=new RStringTable();
resource->handle=(DWORD)strtable;
resource->resgroup=resgroup;
_tcscpy(resource->name, name);
_tcscpy(resource->filename, name);
AddRes(this, RES_STRTABLE, resource);
return strtable;
}
}
return 0;
}
开发者ID:ueverything,项目名称:mmo-resourse,代码行数:24,代码来源:hgeresource.cpp
示例18: GetMusic
HMUSIC hgeResourceManager::GetMusic(CONST TCHAR *name, INT resgroup)
{
HMUSIC reshandle;
RMusic *resource;
ResDesc *Res=FindRes(this, RES_MUSIC, name);
if(Res) return (HMUSIC)Res->Get(this);
else
{
reshandle=hge->Music_Load(name);
if(reshandle)
{
resource=new RMusic();
resource->handle=reshandle;
resource->resgroup=resgroup;
_tcscpy(resource->name, name);
_tcscpy(resource->filename, name);
AddRes(this, RES_MUSIC, resource);
return reshandle;
}
}
return 0;
}
开发者ID:ueverything,项目名称:mmo-resourse,代码行数:24,代码来源:hgeresource.cpp
示例19: GetDistortionMesh
hgeDistortionMesh* hgeResourceManager::GetDistortionMesh(CONST TCHAR *name)
{
ResDesc *Res=FindRes(this, RES_DISTORT, name);
if(Res) return (hgeDistortionMesh *)Res->Get(this);
else return 0;
}
开发者ID:ueverything,项目名称:mmo-resourse,代码行数:6,代码来源:hgeresource.cpp
示例20: GetParticleSystem
hgeParticleSystem* hgeResourceManager::GetParticleSystem(CONST TCHAR *name)
{
ResDesc *Res=FindRes(this, RES_PARTICLE, name);
if(Res) return (hgeParticleSystem *)Res->Get(this);
else return 0;
}
开发者ID:ueverything,项目名称:mmo-resourse,代码行数:6,代码来源:hgeresource.cpp
注:本文中的FindRes函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论