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; } }
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(); } }
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); } }
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); } }
void Script::abortWait() { _resumeScript(1); }