MCPcopy Create free account
hub / github.com/deathkiller/jazz2-native / OnAnimationStarted

Method OnAnimationStarted

Sources/Jazz2/Scripting/ScriptActorWrapper.cpp:514–532  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

512 }
513
514 void ScriptActorWrapper::OnAnimationStarted()
515 {
516 if (_onAnimationStarted == nullptr || _isDead->Get()) {
517 return;
518 }
519
520 asIScriptEngine* engine = _obj->GetEngine();
521 asIScriptContext* ctx = engine->RequestContext();
522
523 ctx->Prepare(_onAnimationStarted);
524 ctx->SetObject(_obj);
525 std::int32_t r = ctx->Execute();
526 if (r == asEXECUTION_EXCEPTION) {
527 LOGE("An exception \"{}\" occurred in \"{}\". Please correct the code and try again.",
528 ctx->GetExceptionString(), ctx->GetExceptionFunction()->GetDeclaration());
529 }
530
531 engine->ReturnContext(ctx);
532 }
533
534 void ScriptActorWrapper::OnAnimationFinished()
535 {

Callers

nothing calls this directly

Calls 3

GetEngineMethod · 0.80
ExecuteMethod · 0.80
GetMethod · 0.45

Tested by

no test coverage detected