// // Copyright (c) 2014-2015, THUNDERBEAST GAMES LLC All rights reserved // LICENSE: Atomic Game Engine Editor and Tools EULA // Please see LICENSE_ATOMIC_EDITOR_AND_TOOLS.md in repository root for // license information: https://github.com/AtomicGameEngine/AtomicGameEngine // #include #include #include // Move me to Engine #include #include #include "AEEditorCommon.h" namespace AtomicEditor { AEEditorCommon::AEEditorCommon(Context* context) : Application(context) { } void AEEditorCommon::Start() { Input* input = GetSubsystem(); input->SetMouseVisible(true); // Register IPC system context_->RegisterSubsystem(new IPC(context_)); // Instantiate and register the Javascript subsystem Javascript* javascript = new Javascript(context_); context_->RegisterSubsystem(javascript); vm_ = javascript->InstantiateVM("MainVM"); vm_->InitJSContext(); } void AEEditorCommon::Setup() { #ifdef ATOMIC_3D RegisterEnvironmentLibrary(context_); #endif } void AEEditorCommon::Stop() { context_->RemoveSubsystem(); vm_ = 0; context_->RemoveSubsystem(); // make sure JSVM is really down and no outstanding refs // as if not, will hold on engine subsystems, which is bad assert(!JSVM::GetJSVM(0)); } }