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


C++ IParamBlock2::ReleaseDesc方法代码示例

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


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

示例1:

int DxStdMtl2::GetMatIndex(Mtl * m_Mtl)
{
	int				i;
	Mtl			*Std;
	StdMat2  * Shader;
	//	MaxShader   *Shader, *s;


	if(m_Mtl->IsMultiMtl())
	{
		Shader = (StdMat2 *)GetRefTarg();

		// I use the SubAnims here, as I do not want any NULL material introduced that are not visible to the user
		// this can happen when you have N materials and you select N+1 mat ID - the material will add a NULL material 
		// to the list to compensate - this screws with the index into the paramblock
		for(i=0; i < m_Mtl->NumSubs(); i++)
		{	
			Std = (Mtl*)m_Mtl->SubAnim(i);

			if(Std!=NULL)
			{
				if(Std->NumSubMtls()>0)
				{

					for(int j=0; j< Std->NumSubMtls();j++)
					{
						Mtl * subMtl = Std->GetSubMtl(j);
						if(subMtl == Shader)
							Std = subMtl;

					}
				}
				MSPlugin* plugin = (MSPlugin*)((ReferenceTarget*)Std)->GetInterface(I_MAXSCRIPTPLUGIN);
				ReferenceTarget * targ = NULL;
				if(plugin){
					targ = plugin->get_delegate();
					Std = (Mtl*)targ;
				}
				if(Std == Shader)
				{
					int id=0;
					// this gets interesting - the MatID are editable !! must get them from the PAramblock
					IParamBlock2 * pblock = m_Mtl->GetParamBlock(0);	// there is only one
					if(pblock)
					{
						ParamBlockDesc2 * pd = pblock->GetDesc();

						for(int j=0;j<pd->count;j++)
						{
							if(_tcsicmp(_T("materialIDList"),pd->paramdefs[j].int_name)==0)	//not localised
							{
								//int id;
								pblock->GetValue(j,0,id,FOREVER,i); 
								id = id+1;	//for some reason this is stored as a zero index, when a 1's based index is used
							}	

						}
						pblock->ReleaseDesc();

					}
					return(id);
				}
			}
		}
	}
	return(0);
}
开发者ID:whztt07,项目名称:OgreGameProject,代码行数:67,代码来源:DxStdMtl2.cpp


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