Handles the game flow between various game modes, e.g. login => city view
コード例 #1
0
ファイル: Main.cs プロジェクト: terrynoya/FreeSO
        internal static void RunGame()
        {
            ImageLoader.BaseFunction = iOSImageLoader.iOSFromStream;
            var iPad = UIDevice.CurrentDevice.Model.Contains("iPad");

            //TODO: disable iPad retina somehow
            FSOEnvironment.ContentDir         = "Content/";
            FSOEnvironment.GFXContentDir      = "Content/iOS/";
            FSOEnvironment.UserDir            = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
            FSOEnvironment.Linux              = true;
            FSOEnvironment.DirectX            = false;
            FSOEnvironment.SoftwareKeyboard   = true;
            FSOEnvironment.SoftwareDepth      = true;
            FSOEnvironment.EnableNPOTMip      = true;
            FSOEnvironment.GLVer              = 2;
            FSOEnvironment.UseMRT             = false;
            FSOEnvironment.UIZoomFactor       = iPad?1:2;
            FSOEnvironment.DPIScaleFactor     = iPad ? 2 : 1;
            FSOEnvironment.TexCompress        = false;
            FSOEnvironment.TexCompressSupport = false;

            FSOEnvironment.GameThread = Thread.CurrentThread;
            FSOEnvironment.Enable3D   = true;
            ITTSContext.Provider      = AppleTTSContext.PlatformProvider;

            FSO.Files.ImageLoader.UseSoftLoad = false;

            /*
             * var settings = new NinjectSettings();
             * settings.LoadExtensions = false;
             */

            if (MainOrg != null)
            {
                var cont = new FSO.Client.GameController(null);
            }
            MainOrg = FSO.Client.FSOProgram.ShowDialog;

            GlobalSettings.Default.CityShadows = false;


            var set = GlobalSettings.Default;

            set.TargetRefreshRate  = 60;
            set.CurrentLang        = "english";
            set.Lighting           = true;
            set.SmoothZoom         = true;
            set.AntiAlias          = false;
            set.LightingMode       = 3;
            set.AmbienceVolume     = 10;
            set.FXVolume           = 10;
            set.MusicVolume        = 10;
            set.VoxVolume          = 10;
            set.GraphicsWidth      = (int)UIScreen.MainScreen.Bounds.Width;
            set.DirectionalLight3D = false;
            set.GraphicsHeight     = (int)UIScreen.MainScreen.Bounds.Height;

            if (File.Exists(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "The Sims Online.zip")))
            {
                File.Delete(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "The Sims Online.zip"));
            }

            var start = new GameStartProxy();

            start.SetPath(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "The Sims Online/TSOClient/"));//"/private/var/mobile/Documents/The Sims Online/TSOClient/");

            TSOGame game = new TSOGame();

            GameFacade.DirectX        = false;
            FSO.LotView.World.DirectX = false;
            game.Run(Microsoft.Xna.Framework.GameRunBehavior.Asynchronous);

#if !__IOS__ && !__TVOS__
            game.Dispose();
#endif
        }