Initialise() public method

public Initialise ( ) : void
return void
Beispiel #1
0
        public bool Init(Game game)
        {
            Log.log("Init Game");

            InitInternal();
            string[] commandLineArgs = Environment.GetCommandLineArgs();
            string   text            = " -editorpc -language=";
            string   language        = GetLanguage();

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

            if (EngineUtils.GetMapArgument() != null)
            {
                num = 2;
            }

            Log.log("Init DuniaEngine");
            if (!Binding.InitDuniaEngine(Process.GetCurrentProcess().MainModule.BaseAddress, game.MainForm.Handle, game.MainForm.Viewport.Handle, string.Join(" ", commandLineArgs, num, commandLineArgs.Length - num) + text, true, true, m_delegateMessagePumpCallback))
            {
                return(false);
            }
            // TODO:Pretty Slow do we need?
            //foreach (ProcessModule processModule in Process.GetCurrentProcess().Modules)
            //{
            //	if (processModule.ModuleName.StartsWith("Nomad") || processModule.ModuleName.StartsWith("InGameEditor"))
            //	{
            //		Binding.FCE_Hack_Init(processModule.BaseAddress);
            //	}
            //}

            Log.log("Acquiring Input");
            Binding.FCE_Engine_AutoAcquireInput(true);
            //Editor.Init(); // TODO:Editor Init ? Hooks?
            game.Initialise();

            Binding.FCE_Engine_Reset(game.MainForm.Handle, game.MainForm.Viewport.Handle, m_delegateMessagePumpCallback);
            if (!Directory.Exists(PersonalPath))
            {
                Directory.CreateDirectory(PersonalPath);
            }
            m_initialized = true;
            return(true);
        }
Beispiel #2
0
        public bool Init(Game game)
        {
            Log.log("Init Game");

            InitInternal();
            string[] commandLineArgs = Environment.GetCommandLineArgs();
            string text = " -editorpc -language=";
            string language = GetLanguage();
            if (language.Length == 0)
            {
                ResourceManager resourceManager = new ResourceManager("FC3.Properties.Resources", Assembly.GetExecutingAssembly());
                string @string = resourceManager.GetString("IDS_ERR_MISSING_REGISTRY_KEY");
                Log.error(@string, "Far Cry 3 Map Editor");
                return false;
            }
            text += language;
            int num = 1;
            if (EngineUtils.GetMapArgument() != null)
            {
                num = 2;
            }

            Log.log("Init DuniaEngine");
            if (!Binding.InitDuniaEngine(Process.GetCurrentProcess().MainModule.BaseAddress, game.MainForm.Handle, game.MainForm.Viewport.Handle, string.Join(" ", commandLineArgs, num, commandLineArgs.Length - num) + text, true, true, m_delegateMessagePumpCallback))
            {
                return false;
            }
            // TODO:Pretty Slow do we need?
            //foreach (ProcessModule processModule in Process.GetCurrentProcess().Modules)
            //{
            //	if (processModule.ModuleName.StartsWith("Nomad") || processModule.ModuleName.StartsWith("InGameEditor"))
            //	{
            //		Binding.FCE_Hack_Init(processModule.BaseAddress);
            //	}
            //}

            Log.log("Acquiring Input");
            Binding.FCE_Engine_AutoAcquireInput(true);
            //Editor.Init(); // TODO:Editor Init ? Hooks?
            game.Initialise();

            Binding.FCE_Engine_Reset(game.MainForm.Handle, game.MainForm.Viewport.Handle, m_delegateMessagePumpCallback);
            if (!Directory.Exists(PersonalPath))
            {
                Directory.CreateDirectory(PersonalPath);
            }
            m_initialized = true;
            return true;
        }