Example #1
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="options">Options for the compiler.</param>
        public CompileAction(CompileOptions options, bool usedExternally = false)
        {
            Opcode.InitMachineCodeData();
            CompiledObject.InitTypeData();
            SafeSerializationMgr.CheckIDumperStatics();

            _usedExternally = usedExternally;
            _options        = options;

            _shared = new SafeSharedObjects();
            _shared.FunctionManager          = new FunctionManager(_shared);
            _shared.GameEventDispatchManager = new NoopGameEventDispatchManager();
            _shared.Processor     = new NoopProcessor();
            _shared.ScriptHandler = new KSScript();
            _shared.Screen        = new Screen();
            _shared.UpdateHandler = new UpdateHandler();
            _shared.VolumeMgr     = new VolumeManager();
            _shared.FunctionManager.Load();

            _compilerOptions = new CompilerOptions()
            {
                LoadProgramsInSameAddressSpace = false,
                IsCalledFromRun = false,
                FuncManager     = _shared.FunctionManager
            };

            _logger        = new CompilerLogger();
            _scriptLoader  = new KerboscriptLoader(_shared.VolumeMgr as VolumeManager, _logger, _options);
            _scriptDeleter = new KerboscriptDeleter(_options);
        }
Example #2
0
 // This is what KSP calls during the initial loading screen (the screen
 // with the progress bar and all of the "Turning correct end toward space"
 // funny messages.)  This is where kOS *should* be putting all the
 // static initializing that does not change per-part, or per-vessel
 // or per-CPU.  It might be true that some of what we're doing up above
 // in OnLoad and OnStart might relly belong here.
 //
 // At some future point it would be a really good idea to look very carefully
 // at *everything* being done during those initialzations and see if any of
 // those steps really are meant to be static do-once steps that belong here
 // instead:
 public override void OnAwake()
 {
     Opcode.InitMachineCodeData();
     CompiledObject.InitTypeData();
 }
Example #3
0
 // This is what KSP calls during the initial loading screen (the screen
 // with the progress bar and all of the "Turning correct end toward space"
 // funny messages.)  This is where kOS *should* be putting all the
 // static initializing that does not change per-part, or per-vessel
 // or per-CPU.  It might be true that some of what we're doing up above
 // in OnLoad and OnStart might really belong here.
 //
 // At some future point it would be a really good idea to look very carefully
 // at *everything* being done during those initialzations and see if any of
 // those steps really are meant to be static do-once steps that belong here
 // instead:
 public override void OnAwake()
 {
     Opcode.InitMachineCodeData();
     CompiledObject.InitTypeData();
     SafeSerializationMgr.CheckIDumperStatics();
 }