Пример #1
0
        protected override void Initialize()
        {
            try
            {
                RootTag = BitIO.FromFile("ff.dat", false);
            }
            catch (Exception e)
            {
                string message = e.Message;
                BitIO.ToFile(new SharpTag(), "ff.dat", false);
                RootTag = BitIO.FromFile("ff.dat", false);
            }

            this.IsFixedTimeStep = true;
            if (RootTag.ContainsKey("SETTINGS"))
            {
                Settings.Load(RootTag.GetSharpTag("SETTINGS"));
            }
            else
            {
                Settings.Init();
            }
            Graphics.PreferredBackBufferWidth  = (int)(Settings.WindowWidth * Settings.WindowScale);
            Graphics.PreferredBackBufferHeight = (int)(Settings.WindowHeight * Settings.WindowScale);
            Graphics.ApplyChanges();

#if DEBUG
            Window.Title = "(DEBUG) Final Fantasy: Dawn of Souls";
#else
            Window.Title = "Final Fantasy: Dawn of Souls";
#endif
            Window.AllowUserResizing = false;
            Window.AllowAltF4        = false;

            MediaCache.Init(GraphicsDevice);
            InitDefaultMedia();
            InitVariables();
            base.Initialize();
        }