Esempio n. 1
0
 public static bool IsSpinPressed(Keyboard inputKeyboard, IList <JoyStick> inputJoysticks)
 {
     if (KeyMap.Instance.Spin is Keyboard.Modifier)
     {
         if (inputKeyboard.IsModifierDown((Keyboard.Modifier)KeyMap.Instance.Spin))
         {
             return(true);
         }
     }
     else
     {
         if (inputKeyboard.IsKeyDown((KeyCode)KeyMap.Instance.Spin) || FrameWorkStaticHelper.GetJoystickButton(inputJoysticks, KeyMap.Instance.JoystickSpin))
         {
             return(true);
         }
     }
     return(false);
 }
Esempio n. 2
0
        public GraphicsQuality EstimateQualitySettingsAndWriteEngineConfig()
		{
            

            hasResults = true;
		    float fps = GetAverageFPS();
            EngineConfig.LoadEngineConfig();
            fullScreen = "Yes";
		    GraphicsQuality quality;
            bool hiEndVS = root.RenderSystem.Capabilities.IsShaderProfileSupported("vs_3_0");
           
            List<String> videoOptions= FrameWorkStaticHelper.GetVideoModes(true, 800, 600);
            
            
            if(videoOptions.Count == 0)
            {
            	videoOptions.Add("800 x 600 @ 32-bit colour");
            	MessageBox.Show("Your system is incapable of displaying 800x600 or better resolution. Trying to force 800x600","Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
			int maxVO = 0;
            int minVO = videoOptions.Count - 1;

            List<object> aaOptions = FrameWorkStaticHelper.GetAntialiasingModes();
            int maxAA = aaOptions.Count - 1;

            LogManager.Singleton.LogMessage(LogMessageLevel.LML_CRITICAL, "Performance test results. FPS: " + fps);
                    
            if(fps < 50)
            {
                // very low
                quality= GraphicsQuality.VeryLow;
                videoMode = videoOptions[minVO];
                antialiasing = aaOptions[0].ToString();
                vsync = "No";
                EngineConfig.UseHydrax = false;
                EngineConfig.ShadowsQuality = EngineConfig.ShadowsQualityTypes.None;
                EngineConfig.LowDetails = true;
                EngineConfig.BloomEnabled = false;
            } else 
            if(fps < 250)
            {
                // low
                quality = GraphicsQuality.Low;
                videoMode = videoOptions[(int)System.Math.Floor(maxVO * 0.70f)];
                antialiasing = aaOptions[0].ToString();
                vsync = "No";
                EngineConfig.UseHydrax = false;
                EngineConfig.ShadowsQuality = EngineConfig.ShadowsQualityTypes.None;
                EngineConfig.LowDetails = false;
                EngineConfig.BloomEnabled = false;
            }
            else 
            if (fps < 400)
            {
                // medium
                quality = GraphicsQuality.Medium;
                videoMode = videoOptions[(int)System.Math.Floor(minVO * 0.50f)];
                antialiasing = aaOptions[0].ToString();
                vsync = "No";
                EngineConfig.UseHydrax = false;
                EngineConfig.ShadowsQuality = EngineConfig.ShadowsQualityTypes.Low;
                EngineConfig.LowDetails = false;
                EngineConfig.BloomEnabled = false;
            }
            else
            if (fps < 600)
            {
                // medium - better
                quality = GraphicsQuality.UpperMedium;
                vsync = "Yes";
                videoMode = videoOptions[maxVO];
                antialiasing = aaOptions[(int)System.Math.Floor(maxAA * 0.50f)].ToString();
                EngineConfig.UseHydrax = false;
                EngineConfig.ShadowsQuality = EngineConfig.ShadowsQualityTypes.Low;
                EngineConfig.LowDetails = false;
                EngineConfig.BloomEnabled = false;
            }
            else
            if (fps < 750)
            {
                // high
                quality = GraphicsQuality.High;
                vsync = "Yes";
                videoMode = videoOptions[maxVO];
                antialiasing = aaOptions[(int)System.Math.Floor(maxAA * 0.75f)].ToString();
                EngineConfig.UseHydrax = hiEndVS;
                EngineConfig.ShadowsQuality = EngineConfig.ShadowsQualityTypes.Low;
                EngineConfig.LowDetails = false;
                EngineConfig.BloomEnabled = false;
            }
            else
            if (fps < 900)
            {
                // higher
                quality = GraphicsQuality.VeryHigh;
                vsync = "Yes";
                videoMode = videoOptions[maxVO];
                antialiasing = aaOptions[(int)System.Math.Floor(maxAA * 0.85f)].ToString();
                EngineConfig.UseHydrax = hiEndVS;
                EngineConfig.ShadowsQuality = EngineConfig.ShadowsQualityTypes.Medium;
                EngineConfig.LowDetails = false;
                EngineConfig.BloomEnabled = false;
            }
            else
            {
                // hi-end
                quality = GraphicsQuality.Superb;
                vsync = "Yes";
                videoMode = videoOptions[maxVO];
                antialiasing = aaOptions[maxAA].ToString();
                EngineConfig.UseHydrax = hiEndVS;
                EngineConfig.ShadowsQuality = EngineConfig.ShadowsQualityTypes.High;
                EngineConfig.LowDetails = false;
                EngineConfig.BloomEnabled = false;
            }
            
            EngineConfig.SaveEngineConfig();

		    return quality;
		}
Esempio n. 3
0
 public static bool IsEscapePressed(Keyboard inputKeyboard, IList <JoyStick> inputJoysticks)
 {
     return(inputKeyboard.IsKeyDown(KeyMap.Instance.Escape) || FrameWorkStaticHelper.GetJoystickButton(inputJoysticks, KeyMap.Instance.JoystickEscape));
 }
Esempio n. 4
0
 public static bool IsEnterPressed(Keyboard inputKeyboard, IList <JoyStick> inputJoysticks)
 {
     return(inputKeyboard.IsKeyDown(KeyMap.Instance.Enter) || inputKeyboard.IsKeyDown(KeyCode.KC_NUMPADENTER) || FrameWorkStaticHelper.GetJoystickButton(inputJoysticks, KeyMap.Instance.JoystickEnter) ||
            FrameWorkStaticHelper.GetJoystickButton(inputJoysticks, KeyMap.Instance.JoystickGun));
 }