コード例 #1
0
        static MyVideoSettingsManager()
        {
            m_aspectRatios = new MyAspectRatio[MyUtils.GetMaxValueFromEnum <MyAspectRatioEnum>() + 1];
            Action <bool, MyAspectRatioEnum, float, string, bool> add =
                delegate(bool isTripleHead, MyAspectRatioEnum aspectRatioEnum, float aspectRatioNumber, string textShort, bool isSupported)
            {
                m_aspectRatios[(int)aspectRatioEnum] = new MyAspectRatio(isTripleHead, aspectRatioEnum, aspectRatioNumber, textShort, isSupported);
            };

            add(false, MyAspectRatioEnum.Normal_4_3, 4.0f / 3.0f, "4:3", true);
            add(false, MyAspectRatioEnum.Normal_16_9, 16.0f / 9.0f, "16:9", true);
            add(false, MyAspectRatioEnum.Normal_16_10, 16.0f / 10.0f, "16:10", true);

            add(false, MyAspectRatioEnum.Dual_4_3, 2 * 4.0f / 3.0f, "Dual 4:3", true);
            add(false, MyAspectRatioEnum.Dual_16_9, 2 * 16.0f / 9.0f, "Dual 16:9", true);
            add(false, MyAspectRatioEnum.Dual_16_10, 2 * 16.0f / 10.0f, "Dual 16:10", true);

            add(true, MyAspectRatioEnum.Triple_4_3, 3 * 4.0f / 3.0f, "Triple 4:3", true);
            add(true, MyAspectRatioEnum.Triple_16_9, 3 * 16.0f / 9.0f, "Triple 16:9", true);
            add(true, MyAspectRatioEnum.Triple_16_10, 3 * 16.0f / 10.0f, "Triple 16:10", true);

            add(false, MyAspectRatioEnum.Unsupported_5_4, 5f / 4f, "5:4", false);

            if (MyFinalBuildConstants.IS_OFFICIAL)
            {
                DebugDisplayModes = new MyDisplayMode[0];
            }
            else
            {
                // For testing windowed mode dual/triple screens
                DebugDisplayModes = new MyDisplayMode[]
                {
                    new MyDisplayMode(1600, 600, 60),
                    new MyDisplayMode(1920, 480, 60),
                    new MyDisplayMode(1920, 817, 60),
                };
            }
        }
コード例 #2
0
        static MyVideoSettingsManager()
        {
            Action <bool, MyAspectRatioEnum, float, string, bool> action1 = (isTripleHead, aspectRatioEnum, aspectRatioNumber, textShort, isSupported) => m_aspectRatios[(int)aspectRatioEnum] = new MyAspectRatio(isTripleHead, aspectRatioEnum, aspectRatioNumber, textShort, isSupported);

            action1(false, MyAspectRatioEnum.Normal_4_3, 1.333333f, "4:3", true);
            action1(false, MyAspectRatioEnum.Normal_16_9, 1.777778f, "16:9", true);
            action1(false, MyAspectRatioEnum.Normal_16_10, 1.6f, "16:10", true);
            action1(false, MyAspectRatioEnum.Dual_4_3, 2.666667f, "Dual 4:3", true);
            action1(false, MyAspectRatioEnum.Dual_16_9, 3.555556f, "Dual 16:9", true);
            action1(false, MyAspectRatioEnum.Dual_16_10, 3.2f, "Dual 16:10", true);
            action1(true, MyAspectRatioEnum.Triple_4_3, 4f, "Triple 4:3", true);
            action1(true, MyAspectRatioEnum.Triple_16_9, 5.333333f, "Triple 16:9", true);
            action1(true, MyAspectRatioEnum.Triple_16_10, 4.8f, "Triple 16:10", true);
            action1(false, MyAspectRatioEnum.Unsupported_5_4, 1.25f, "5:4", false);
            DebugDisplayModes = new MyDisplayMode[0];
        }