Beispiel #1
0
        public Game(string filePath = "")
        {
            if (filePath.Contains("-t"))
            {
                LevelEV.TESTROOM_LEVELTYPE = GameTypes.LevelType.TOWER;
                filePath = filePath.Replace("-t", "");
            }
            else if (filePath.Contains("-d"))
            {
                LevelEV.TESTROOM_LEVELTYPE = GameTypes.LevelType.DUNGEON;
                filePath = filePath.Replace("-d", "");
            }
            else if (filePath.Contains("-g"))
            {
                LevelEV.TESTROOM_LEVELTYPE = GameTypes.LevelType.GARDEN;
                filePath = filePath.Replace("-g", "");
            }
            if (Thread.CurrentThread.CurrentCulture.Name != "en-US")
            {
                Thread.CurrentThread.CurrentCulture   = new CultureInfo("en-US", false);
                Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US", false);
            }
            m_commandLineFilePath = filePath;
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";
            EngineEV.ScreenWidth  = 1320;
            EngineEV.ScreenHeight = 720;
            Window.Title          = "Rogue Legacy Enhanced";
            ScreenManager         = new RCScreenManager(this);
            SaveManager           = new SaveGameManager(this);
            IsFixedTimeStep       = false;
            graphics.SynchronizeWithVerticalRetrace = !LevelEV.SHOW_FPS;
            Window.AllowUserResizing = false;
            if (!LevelEV.ENABLE_OFFSCREEN_CONTROL)
            {
                InactiveSleepTime = default(TimeSpan);
            }
            PhysicsManager  = new PhysicsManager();
            EquipmentSystem = new EquipmentSystem();
            EquipmentSystem.InitializeEquipmentData();
            EquipmentSystem.InitializeAbilityCosts();
            GameConfig = default(SettingStruct);
            var form = Control.FromHandle(Window.Handle) as Form;

            if (form != null)
            {
                form.FormClosing += FormClosing;
            }
            GraphicsDeviceManager.PreparingDeviceSettings += ChangeGraphicsSettings;
            SleepUtil.DisableScreensaver();
        }
Beispiel #2
0
 private static extern SleepUtil.EXECUTION_STATE SetThreadExecutionState(SleepUtil.EXECUTION_STATE esFlags);