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


C++ CGPObject类代码示例

本文整理汇总了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;未经允许,请勿转载。