InitInternal() private static method

private static InitInternal ( ) : void
return void
Example #1
0
 public static void Reset(Form mainWindow, Control viewport)
 {
     Engine.InitInternal();
     Editor.Init();
     Binding.FCE_Engine_Reset(mainWindow.Handle, viewport.Handle, Engine.m_delegateMessagePumpCallback);
     Engine.m_initialized = true;
 }
Example #2
0
        public static bool Init(Form mainWindow, Control viewport)
        {
            Engine.InitInternal();
            string[] commandLineArgs = Environment.GetCommandLineArgs();
            string   text            = " -editorpc -language=";
            string   language        = Engine.GetLanguage();

            if (language.Length == 0)
            {
                ResourceManager resourceManager = new ResourceManager("FC3Editor.Properties.Resources", Assembly.GetExecutingAssembly());
                string          @string         = resourceManager.GetString("IDS_ERR_MISSING_REGISTRY_KEY");
                MessageBox.Show(@string, "Far Cry 3 Map Editor");
                return(false);
            }
            text += language;
            int num = 1;

            if (Program.GetMapArgument() != null)
            {
                num = 2;
            }
            if (!Binding.InitDuniaEngine(Process.GetCurrentProcess().MainModule.BaseAddress, mainWindow.Handle, viewport.Handle, string.Join(" ", commandLineArgs, num, commandLineArgs.Length - num) + text, true, true, Engine.m_delegateMessagePumpCallback))
            {
                return(false);
            }
            foreach (ProcessModule processModule in Process.GetCurrentProcess().Modules)
            {
                if (processModule.ModuleName.StartsWith("FC3Editor.Core") || processModule.ModuleName.StartsWith("InGameEditor"))
                {
                    Binding.FCE_Hack_Init(processModule.BaseAddress);
                }
            }
            Binding.FCE_Engine_AutoAcquireInput(true);
            Editor.Init();
            Binding.FCE_Engine_Reset(mainWindow.Handle, viewport.Handle, Engine.m_delegateMessagePumpCallback);
            if (!Directory.Exists(Engine.PersonalPath))
            {
                Directory.CreateDirectory(Engine.PersonalPath);
            }
            Engine.m_initialized = true;
            return(true);
        }