| 70 | } |
| 71 | |
| 72 | void ScriptCreateCoRoutine(asIScriptFunction *func, CScriptDictionary *arg) |
| 73 | { |
| 74 | if( func == 0 ) |
| 75 | return; |
| 76 | |
| 77 | asIScriptContext *ctx = asGetActiveContext(); |
| 78 | if( ctx ) |
| 79 | { |
| 80 | // Get the context manager from the user data |
| 81 | CContextMgr *ctxMgr = reinterpret_cast<CContextMgr*>(ctx->GetUserData(CONTEXT_MGR)); |
| 82 | if( ctxMgr ) |
| 83 | { |
| 84 | // Create a new context for the co-routine |
| 85 | asIScriptContext *coctx = ctxMgr->AddContextForCoRoutine(ctx, func); |
| 86 | |
| 87 | // Pass the argument to the context |
| 88 | coctx->SetArgObject(0, arg); |
| 89 | |
| 90 | // The context manager will call Execute() on the context when it is time |
| 91 | } |
| 92 | } |
| 93 | } |
| 94 | |
| 95 | #ifdef AS_MAX_PORTABILITY |
| 96 | void ScriptYield_generic(asIScriptGeneric *) |
no test coverage detected