Exemple #1
0
void Script::process(uint32 elTime)
{
	mTime += elTime;

	switch(mState)
	{
		case SS_Wait_Time:
		{
			if(mTime >= mWaitTimeStamp)
				_resumeScript(0);
		}
		break;

		case SS_Wait_Frame:
		{
			mWaitFrame--;

			if(mWaitFrame <= 0)
				_resumeScript(0);
		}
		break;

		case SS_Not_Loaded:
		default:
		break;
	}
}
Exemple #2
0
void Script::runFile(const int8 *fileName)
{
    assert(mEngine->getMasterState() && "Invalid engine master state");
    assert(mThreadState && "Invalid thread state");

    if(luaL_loadfile(mThreadState,fileName) == 0)
    {
        _resumeScript(0);
    }
    else
    {
        _formatError();
    }
}
Exemple #3
0
void Script::runFile(const int8 *fileName)
{
	assert(mEngine->getMasterState() && "Invalid engine master state");
	assert(mThreadState && "Invalid thread state");

	if(luaL_loadfile(mThreadState,fileName) == 0)
	{
		_resumeScript(0);
	}
	else
	{
		_formatError();
		gLogger->logMsgF("ScriptingEngine::Syntax Error: %s",MSG_NORMAL,mLastError);
	}
}
Exemple #4
0
void Script::run()
{
    assert(mEngine->getMasterState() && "Invalid engine master state");
    assert(mThreadState && "Invalid thread state");

    if(luaL_loadfile(mThreadState,mFile) == 0)
    {
        _resumeScript(0);
    }
    else
    {
        _formatError();
        gLogger->log(LogManager::EMERGENCY,"ScriptingEngine::Syntax Error: %s",mLastError);
    }
}
Exemple #5
0
void Script::abortWait()
{
	_resumeScript(1);
}