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


C++ MOAILuaState::CheckParams方法代码示例

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


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

示例1: _renderFrameBuffer

int GIIHelper::_renderFrameBuffer( lua_State *L ){
	MOAILuaState state (L);
	if ( !state.CheckParams ( 1, "U" )) return 0;
	MOAIFrameBufferRenderCommand* command = state.GetLuaObject < MOAIFrameBufferRenderCommand >( -1, false );
	if ( command ) {
		if ( command->IsEnabled() && command->GetFrameBuffer() ) {
			zglBegin();
			command->Render();
			zglEnd();
		}
	} else {
		MOAIFrameBuffer* frameBuffer = state.GetLuaObject < MOAIFrameBuffer >( -1, false );
		if ( frameBuffer ) {
			zglBegin();
			frameBuffer->Render ( NULL );
			zglEnd();
		}
	}
	// MOAIFrameBuffer* frameBuffer = state.GetLuaObject < MOAIFrameBuffer >( 1, false );
	// MOAIGfxDevice& device = MOAIGfxDevice::Get ();
	// if (frameBuffer) {
	// 	zglBegin();
	// 	frameBuffer->Render( NULL );
	// 	zglEnd();
	// }
	return 0;
}
开发者ID:pixpil,项目名称:gii,代码行数:27,代码来源:GIIHelper.cpp

示例2: _stepSim

int GIIHelper::_stepSim( lua_State *L ){
	MOAILuaState state (L);
	if ( !state.CheckParams ( 1, "N" )) return 0;
	double step = state.GetValue< double >( 1, 0.0f );
	GIIHelper::Get().stepSim( step );
	return 0;
}
开发者ID:pixpil,项目名称:gii,代码行数:7,代码来源:GIIHelper.cpp

示例3: _setBufferSize

int GIIHelper::_setBufferSize( lua_State *L){
	MOAILuaState state (L);
	if ( !state.CheckParams ( 1, "NN" )) return 0;
	u32 width=state.GetValue<u32>(1, 0);
	u32 height=state.GetValue<u32>(2, 0);
	MOAIGfxDevice::Get ().SetBufferSize ( width, height );
	return 0;
}
开发者ID:pixpil,项目名称:gii,代码行数:8,代码来源:GIIHelper.cpp

示例4: _setVertexTransform

int GIIHelper::_setVertexTransform( lua_State *L){
	MOAILuaState state (L);
	if ( !state.CheckParams ( 1, "U" )) return 0;
	MOAITransformBase* trans = state.GetLuaObject< MOAITransformBase >(1, true);
	if ( trans ) {
		MOAIGfxDevice::Get().SetVertexTransform( MOAIGfxDevice::VTX_WORLD_TRANSFORM, trans->GetLocalToWorldMtx() );
	}
	return 0;
}
开发者ID:pixpil,项目名称:gii,代码行数:9,代码来源:GIIHelper.cpp

示例5: _openFile

/**	@name	openFile
	@text	Opens a new file to receive log messages.
	
	@in		string filename
	@out	nil
*/
int MOAILogMgr::_openFile ( lua_State* L ) {

	MOAILuaState state ( L );
	if ( !state.CheckParams ( 1, "S" )) return 0;
	
	cc8* filename = state.GetValue < cc8* >( 1, "" );
	MOAILogMgr::Get ().OpenFile ( filename );
	
	return 0;
}
开发者ID:Heyzap,项目名称:moai-dev,代码行数:16,代码来源:MOAILogMgr.cpp

示例6: _log

/**	@name	log
	@text	Alias for print.
	
	@in		string message
	@out	nil
*/
int MOAILogMgr::_log ( lua_State* L ) {

	MOAILuaState state ( L );
	if ( !state.CheckParams ( 1, "S" )) return 0;

	cc8* msg = state.GetValue < cc8* >( 1, "" );
	ZLLog::Print( msg );
	
	return 0;
}
开发者ID:Heyzap,项目名称:moai-dev,代码行数:16,代码来源:MOAILogMgr.cpp

示例7: _areaForRect

/**	@name	areaForRect
	@text	Returns the area for the specified rectangle.

	@in		number x1
	@in		number y1
	@in		number x2
	@in		number y2
	@out	number area			The calculated area.
*/
int MOAICpShape::_areaForRect ( lua_State* L ) {
	MOAILuaState state ( L );
	if ( !state.CheckParams ( 1, "NNNN" )) return 0;

	ZLMetaRect < cpFloat > rect = state.GetRect < cpFloat >( 1 );
	rect.Bless ();
	
	lua_pushnumber ( L, rect.Area ());
	return 1;
}
开发者ID:AzureRodrigo,项目名称:moai-dev,代码行数:19,代码来源:MOAICpShape.cpp

示例8: _timeToFrames

/**	@name	timeToFrames
	@text	Converts the number of time passed in seconds to frames.

	@in		number time			The number of seconds.
	@out	number frames		The equivilant number of frames for the specified number of seconds.
*/
int MOAISim::_timeToFrames ( lua_State* L ) {

	MOAILuaState state ( L );
	if ( !state.CheckParams ( 1, "N" )) return 0;
	
	float time = state.GetValue < float >( 1, 0.0f );
	
	MOAISim& device = MOAISim::Get ();
	lua_pushnumber ( state, time / device.mStep );
	
	return 1;
}
开发者ID:,项目名称:,代码行数:18,代码来源:

示例9: _showStyle

/**	@name	showStyle
	@text	Enables of disables drawing of a given debug line style.
	
	@in		number styleID		See MOAIDebugLines class documentation for a list of styles.
	@opt	boolean show		Default value is 'true'
	@out	nil
*/
int MOAIDebugLines::_showStyle ( lua_State* L ) {

	MOAILuaState state ( L );
	if ( !state.CheckParams ( 1, "N" )) return 0;
	
	u32 styleID		= state.GetValue < u32 >( 1, 0 );
	bool show		= state.GetValue < bool >( 2, true );
	
	MOAIDebugLines::Get ().ShowStyle ( styleID, show );
	
	return 0;
}
开发者ID:AzureRodrigo,项目名称:moai-dev,代码行数:19,代码来源:MOAIDebugLines.cpp

示例10: _framesToTime

/**	@name	framesToTime
	@text	Converts the number of frames to time passed in seconds.

	@in		number frames		The number of frames.
	@out	number time			The equivilant number of seconds for the specified number of frames.
*/
int MOAISim::_framesToTime ( lua_State* L ) {

	MOAILuaState state ( L );
	if ( !state.CheckParams ( 1, "N" )) return 0;
	
	float frames = state.GetValue < float >( 1, 0.0f );
	
	MOAISim& device = MOAISim::Get ();
	lua_pushnumber ( state, frames * device.mStep );
	
	return 1;
}
开发者ID:,项目名称:,代码行数:18,代码来源:

示例11: _parseString

/**	@name	parseString
	@text	Parses the contents of the specified string as XML.

	@in		MOAIXmlParser self
	@in		string filename			The XML data stored in a string.
	@out	table data				A tree of tables representing the XML.
*/
int MOAIXmlParser::_parseString ( lua_State* L ) {

    MOAILuaState state ( L );
    if ( !state.CheckParams ( 1, "S" )) return 0;

    cc8* xml = lua_tostring ( state, 1 );

    TiXmlDocument doc;
    doc.Parse ( xml );
    MOAIXmlParser::Parse ( state, doc.RootElement ());

    return 1;
}
开发者ID:,项目名称:,代码行数:20,代码来源:

示例12: _removeRenderPass

/**	@name	removeRenderPass
	@text	Removes the specified prim from the render stack.

	@in		MOAIProp2D prop		The viewport of the render prim.
	@out	nil
*/
int MOAISim::_removeRenderPass ( lua_State* L ) {

	MOAILuaState state ( L );
	if ( !state.CheckParams ( 1, "U" )) return 0;
	
	MOAIProp* prop = state.GetLuaObject < MOAIProp >( 1 );
	if ( !prop ) return 0;
	
	MOAISim& device = MOAISim::Get ();
	device.RemoveRenderPass ( prop );

	return 0;
}
开发者ID:,项目名称:,代码行数:19,代码来源:

示例13: _blockOnAction

/**	@name	blockOnAction
	@text	Skip updating current thread until the specified action is
			no longer busy. A little more efficient than spinlocking from
			Lua.

	@in		MOAIAction blocker
	@out	nil
*/
int MOAICoroutine::_blockOnAction ( lua_State* L ) {
	MOAILuaState state ( L );
	if ( !state.CheckParams ( 1, "U" )) return 0;

	MOAIAction* current = MOAIActionMgr::Get ().GetCurrentAction ();
	if ( !current ) return 0;
	
	MOAIAction* blocker = state.GetLuaObject < MOAIAction >( 1, true );
	if ( !blocker || !blocker->IsBusy ()) return 0;
	
	current->SetBlocker ( blocker );
	
	return lua_yield ( state, 0 );
}
开发者ID:,项目名称:,代码行数:22,代码来源:

示例14: _registerLogMessage

/**	@name	registerLogMessage
	@text	Register a format string to handle a log message. Register
			an empty string to hide messages.
	
	@in		number messageID
	@opt	string formatString		Default value is an empty string.
	@opt	number level			One of MOAILogMgr.LOG_ERROR, MOAILogMgr.LOG_WARNING, MOAILogMgr.LOG_STATUS.
									Default value is MOAILogMgr.LOG_STATUS.
	@out	nil
*/
int MOAILogMgr::_registerLogMessage ( lua_State* L ) {
	UNUSED ( L );

	MOAILuaState state ( L );
	if ( !state.CheckParams ( 1, "N" )) return 0;

	u32 messageID		= state.GetValue < u32 >( 1, 0 );
	cc8* formatString	= state.GetValue < cc8* >( 2, "" );
	u32 level			= state.GetValue < u32 >( 3, LOG_STATUS );

	MOAILogMgr::Get ().RegisterLogMessage ( messageID, level, formatString );

	return 0;
}
开发者ID:Heyzap,项目名称:moai-dev,代码行数:24,代码来源:MOAILogMgr.cpp

示例15: _parseFile

/**	@name	parseFile
	@text	Parses the contents of the specified file as XML.

	@in		MOAIXmlParser self
	@in		string filename			The path of the file to read the XML data from.
	@out	table data				A tree of tables representing the XML.
*/
int MOAIXmlParser::_parseFile ( lua_State* L ) {

    MOAILuaState state ( L );
    if ( !state.CheckParams ( 1, "S" )) return 0;

    cc8* filename = lua_tostring ( state, 1 );

    if ( MOAILogMessages::CheckFileExists ( filename, L )) {
        TiXmlDocument doc;
        doc.LoadFile ( filename );
        MOAIXmlParser::Parse ( state, doc.RootElement ());
        return 1;
    }
    return 0;
}
开发者ID:,项目名称:,代码行数:22,代码来源:


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