• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ CGPObject类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: ParseEmitterFxStrings

//------------------------------------------------------
// ParseEmitterFxStrings
//	Reads in a group of fx file names and registers them
//
// input:
//	Parse group that contains the list of fx to parse
//
// return:
//	success of parse operation.
//------------------------------------------------------
bool CPrimitiveTemplate::ParseEmitterFxStrings( CGPValue *grp )
{
	const char	*val;
	int			handle;

	if ( grp->IsList() )
	{
		// If we are a list we have to do separate processing
		CGPObject *list = grp->GetList();

		while ( list )
		{
			// name is actually the value contained in the list
			val = list->GetName();
			handle = theFxScheduler.RegisterEffect( val );

			if ( handle )
			{
				mEmitterFxHandles.AddHandle( handle );
			}
			else
			{
				theFxHelper.Print( "FxTemplate: Emitter effect file not found.\n" );
				return false;
			}

			list = (CGPValue *)list->GetNext();
		}
	}
	else
	{
		// Let's get a value
		val = grp->GetTopValue();

		if ( val )
		{
			handle = theFxScheduler.RegisterEffect( val );

			if ( handle )
			{
				mEmitterFxHandles.AddHandle( handle );
			}
			else
			{
				theFxHelper.Print( "FxTemplate: Emitter effect file not found.\n" );
				return false;
			}
		}
		else
		{
			// empty "list"
			theFxHelper.Print( "CPrimitiveTemplate::ParseEmitterFxStrings called with an empty list!\n" );
			return false;
		}
	}

	mFlags |= FX_EMIT_FX;	

	return true;
}
开发者ID:LTolosa,项目名称:Jedi-Outcast,代码行数:70,代码来源:FxTemplate.cpp


示例2: CGPValue

CGPValue *CGPValue::Duplicate(CTextPool **textPool)
{
	CGPValue	*newValue;
	CGPObject	*iterator;
	char		*name;

	if (textPool)
	{
		name = (*textPool)->AllocText((char *)mName, true, textPool);
	}
	else
	{
		name = (char *)mName;
	}

	newValue = new CGPValue(name);
	iterator = mList;
	while(iterator)
	{
		if (textPool)
		{
			name = (*textPool)->AllocText((char *)iterator->GetName(), true, textPool);
		}
		else
		{
			name = (char *)iterator->GetName();
		}
		newValue->AddValue(name);
		iterator = iterator->GetNext();
	}

	return newValue;
}
开发者ID:Joanxt,项目名称:OpenJK,代码行数:33,代码来源:genericparser2.cpp


示例3: Write

bool CGPValue::Write(CTextPool **textPool, int depth)
{
	int				i;
	CGPObject	*next;

	if (!mList)
	{
		return true;
	}

	for(i=0;i<depth;i++)
	{
		(*textPool)->AllocText("\t", false, textPool);
	}

	WriteText(textPool, mName);

	if (!mList->GetNext())
	{
		(*textPool)->AllocText("\t\t", false, textPool);
		mList->WriteText(textPool, mList->GetName());
		(*textPool)->AllocText("\r\n", false, textPool);
	}
	else
	{
		(*textPool)->AllocText("\r\n", false, textPool);

		for(i=0;i<depth;i++)
		{
			(*textPool)->AllocText("\t", false, textPool);
		}
		(*textPool)->AllocText("[\r\n", false, textPool);

		next = mList;
		while(next)
		{
			for(i=0;i<depth+1;i++)
			{
				(*textPool)->AllocText("\t", false, textPool);
			}
			mList->WriteText(textPool, next->GetName());
			(*textPool)->AllocText("\r\n", false, textPool);

			next = next->GetNext();
		}

		for(i=0;i<depth;i++)
		{
			(*textPool)->AllocText("\t", false, textPool);
		}
		(*textPool)->AllocText("]\r\n", false, textPool);
	}

	return true;
}
开发者ID:Joanxt,项目名称:OpenJK,代码行数:55,代码来源:genericparser2.cpp


示例4: ParseModels

//------------------------------------------------------
// ParseModels
//	Reads in a group of models and registers them
//
// input:
//	Parse group that contains the list of models to parse
//
// return:
//	success of parse operation.
//------------------------------------------------------
bool CPrimitiveTemplate::ParseModels( CGPValue *grp )
{
	const char	*val;
	int			handle;

	if ( grp->IsList() )
	{
		// If we are a list we have to do separate processing
		CGPObject *list = grp->GetList();

		while ( list )
		{
			// name is actually the value contained in the list
			val = list->GetName();

			handle = theFxHelper.RegisterModel( val );
			mMediaHandles.AddHandle( handle );

			list = (CGPValue *)list->GetNext();
		}
	}
	else
	{
		// Let's get a value
		val = grp->GetTopValue();

		if ( val )
		{
			handle = theFxHelper.RegisterModel( val );
			mMediaHandles.AddHandle( handle );
		}
		else
		{
			// empty "list"
			theFxHelper.Print( "CPrimitiveTemplate::ParseModels called with an empty list!\n" );
			return false;
		}
	}

	mFlags |= FX_ATTACHED_MODEL;

	return true;
}
开发者ID:LTolosa,项目名称:Jedi-Outcast,代码行数:53,代码来源:FxTemplate.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ CGPSController类代码示例发布时间:2022-05-29
下一篇:
C++ CGPGroup类代码示例发布时间:2022-05-29
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap