public static SGameRenderQuality check_Android() { SGameRenderQuality result = DetectRenderQuality.checkGPU_Android(SystemInfo.graphicsDeviceName); DetectRenderQuality.checkDevice_Android(ref result); return(result); }
public static void Init() { DeviceLevel = SGameRenderQuality.Low; DeviceLevel = DetectRenderQuality.check_Android(); if (PlayerPrefs.HasKey("sgameSettings_RenderQuality")) { RenderQuality = (SGameRenderQuality)Mathf.Clamp(PlayerPrefs.GetInt("sgameSettings_RenderQuality", 0), 0, 2); } else { RenderQuality = DeviceLevel; } if (PlayerPrefs.HasKey("sgameSettings_ParticleQuality")) { ParticleQuality = (SGameRenderQuality)Mathf.Clamp(PlayerPrefs.GetInt("sgameSettings_ParticleQuality", 0), 0, 2); } else { ParticleQuality = RenderQuality; } EnableSound = PlayerPrefs.GetInt("sgameSettings_muteSound", 1) == 1; EnableMusic = PlayerPrefs.GetInt("sgameSettings_muteMusic", 1) == 1; if (PlayerPrefs.HasKey("sgameSettings_EnableVoice")) { EnableVoice = PlayerPrefs.GetInt("sgameSettings_EnableVoice", 1) == 1; } else { EnableVoice = false; } EnableOutline = PlayerPrefs.GetInt("sgameSettings_outline", 0) != 0; TheCastType = (CastType)PlayerPrefs.GetInt("GameSettings_CastType", 1); TheCommonAttackType = (CommonAttactType)PlayerPrefs.GetInt("GameSetting_CommonAttackType", 0); TheSelectType = (SelectEnemyType)PlayerPrefs.GetInt("GameSettings_SelectEnemyType", 1); LunPanSensitivity = !PlayerPrefs.HasKey("GameSettings_LunPanCastSensitivity") ? 1f : PlayerPrefs.GetFloat("GameSettings_LunPanCastSensitivity", 1f); if (DeviceLevel == SGameRenderQuality.Low) { cameraHeight = CameraHeightType.Low; } else { cameraHeight = CameraHeightType.Medium; } if (PlayerPrefs.HasKey("cameraHeight")) { CameraHeight = PlayerPrefs.GetInt("cameraHeight", 1); } JoyStickMoveType = PlayerPrefs.GetInt("joystickMoveType", 1); JoyStickShowType = PlayerPrefs.GetInt("joystickShowType", 0); FpsShowType = PlayerPrefs.GetInt("str_fpsShowType", 0); }
private static SGameRenderQuality checkGPU_Android(string gpuName) { SGameRenderQuality result = SGameRenderQuality.Low; int systemMemorySize = SystemInfo.systemMemorySize; if (systemMemorySize < 1500) { return(SGameRenderQuality.Low); } gpuName = gpuName.ToLower(); char[] array = new char[] { ' ', '\t', '\r', '\n', '+', '-', ':' }; string[] array2 = gpuName.Split(array, 1); if (array2 == null || array2.Length == 0) { return(SGameRenderQuality.Low); } if (array2[0].Contains("vivante")) { result = SGameRenderQuality.Low; } else if (array2[0] == "adreno") { result = DetectRenderQuality.checkGPU_Adreno(array2); } else if (array2[0] == "powervr" || array2[0] == "imagination" || array2[0] == "sgx") { result = DetectRenderQuality.checkGPU_PowerVR(array2); } else if (array2[0] == "arm" || array2[0] == "mali" || (array2.Length > 1 && array2[1] == "mali")) { result = DetectRenderQuality.checkGPU_Mali(array2); } else if (array2[0] == "tegra" || array2[0] == "nvidia") { result = DetectRenderQuality.checkGPU_Tegra(array2); } return(result); }
private static SGameRenderQuality checkGPU_Adreno(string[] tokens) { int num = 0; for (int i = 1; i < tokens.Length; i++) { if (DetectRenderQuality.TryGetInt(ref num, tokens[i])) { if (num < 200) { return(SGameRenderQuality.Low); } if (num < 300) { if (num > 220) { return(SGameRenderQuality.Low); } return(SGameRenderQuality.Low); } else if (num < 400) { if (num >= 330) { return(SGameRenderQuality.High); } if (num >= 320) { return(SGameRenderQuality.Medium); } return(SGameRenderQuality.Low); } else if (num >= 400) { if (num < 420) { return(SGameRenderQuality.Medium); } return(SGameRenderQuality.High); } } } return(SGameRenderQuality.Low); }
private static SGameRenderQuality checkGPU_Tegra(string[] tokens) { bool flag = false; int num = 0; SGameRenderQuality result = SGameRenderQuality.Low; for (int i = 1; i < tokens.Length; i++) { if (DetectRenderQuality.TryGetInt(ref num, tokens[i])) { flag = true; if (num >= 4) { result = SGameRenderQuality.High; break; } if (num == 3) { result = SGameRenderQuality.Medium; break; } } else { string text = tokens[i]; if (text == "k1") { result = SGameRenderQuality.High; flag = true; break; } } } if (!flag) { result = SGameRenderQuality.Medium; } return(result); }
private static SGameRenderQuality checkGPU_PowerVR(string[] tokens) { bool flag = false; bool flag2 = false; SGameRenderQuality result = SGameRenderQuality.Low; int num = 0; for (int i = 1; i < tokens.Length; i++) { string text = tokens[i]; if (text == "sgx") { flag = true; } else { if (text == "rogue") { flag2 = true; break; } if (flag) { bool flag3 = false; int num2 = text.IndexOf("mp"); if (num2 > 0) { DetectRenderQuality.TryGetInt(ref num, text.Substring(0, num2)); flag3 = true; } else if (DetectRenderQuality.TryGetInt(ref num, text)) { for (int j = i + 1; j < tokens.Length; j++) { text = tokens[j].ToLower(); if (text.IndexOf("mp") >= 0) { flag3 = true; break; } } } if (num > 0) { if (num < 543) { result = SGameRenderQuality.Low; } else if (num == 543) { result = SGameRenderQuality.Low; } else if (num == 544) { result = SGameRenderQuality.Low; if (flag3) { result = SGameRenderQuality.Medium; } } else { result = SGameRenderQuality.Medium; } break; } } else if (text.get_Length() > 4) { char c = text.get_Chars(0); char c2 = text.get_Chars(1); if (c == 'g') { if (c2 >= '0' && c2 <= '9') { DetectRenderQuality.TryGetInt(ref num, text.Substring(1)); } else { DetectRenderQuality.TryGetInt(ref num, text.Substring(2)); } if (num > 0) { if (num >= 7000) { result = SGameRenderQuality.High; } else if (num >= 6000) { if (num < 6100) { result = SGameRenderQuality.Low; } else if (num < 6400) { result = SGameRenderQuality.Medium; } else { result = SGameRenderQuality.High; } } else { result = SGameRenderQuality.Low; } break; } } } } } if (flag2) { result = SGameRenderQuality.High; } return(result); }
private static SGameRenderQuality checkGPU_Mali(string[] tokens) { int num = 0; SGameRenderQuality result = SGameRenderQuality.Low; for (int i = 1; i < tokens.Length; i++) { string text = tokens[i]; if (text.get_Length() >= 3) { int num2 = text.LastIndexOf("mp"); bool flag = text.get_Chars(0) == 't'; if (num2 > 0) { int num3 = flag ? 1 : 0; text = text.Substring(num3, num2 - num3); DetectRenderQuality.TryGetInt(ref num, text); } else { if (flag) { text = text.Substring(1); } if (DetectRenderQuality.TryGetInt(ref num, text)) { for (int j = i + 1; j < tokens.Length; j++) { text = tokens[j]; if (text.IndexOf("mp") >= 0) { break; } } } } if (num > 0) { if (num < 400) { result = SGameRenderQuality.Low; } else if (num < 500) { if (num == 400) { result = SGameRenderQuality.Low; } else if (num == 450) { result = SGameRenderQuality.Medium; } else { result = SGameRenderQuality.Low; } } else if (num < 700) { if (!flag) { result = SGameRenderQuality.Low; } else if (num < 620) { result = SGameRenderQuality.Low; } else if (num < 628) { result = SGameRenderQuality.Medium; } else { result = SGameRenderQuality.High; } } else if (!flag) { result = SGameRenderQuality.Low; } else { result = SGameRenderQuality.High; } break; } } } return(result); }
public static void Init() { GameSettings.DeviceLevel = SGameRenderQuality.Low; GameSettings.DeviceLevel = DetectRenderQuality.check_Android(); if (PlayerPrefs.HasKey("sgameSettings_RenderQuality")) { int @int = PlayerPrefs.GetInt("sgameSettings_RenderQuality", 0); GameSettings.RenderQuality = (SGameRenderQuality)Mathf.Clamp(@int, 0, 2); } else { GameSettings.RenderQuality = GameSettings.DeviceLevel; } if (PlayerPrefs.HasKey("sgameSettings_ParticleQuality")) { int int2 = PlayerPrefs.GetInt("sgameSettings_ParticleQuality", 0); GameSettings.ParticleQuality = (SGameRenderQuality)Mathf.Clamp(int2, 0, 2); } else { GameSettings.ParticleQuality = GameSettings.RenderQuality; } int int3 = PlayerPrefs.GetInt("sgameSettings_muteSound", 1); GameSettings.EnableSound = (int3 == 1); int int4 = PlayerPrefs.GetInt("sgameSettings_muteMusic", 1); GameSettings.EnableMusic = (int4 == 1); if (PlayerPrefs.HasKey("sgameSettings_EnableVoice")) { int int5 = PlayerPrefs.GetInt("sgameSettings_EnableVoice", 1); GameSettings.EnableVoice = (int5 == 1); } else { GameSettings.EnableVoice = false; } int int6 = PlayerPrefs.GetInt("GameSettingEnableVibrate", 1); GameSettings.EnableVibrate = (int6 == 1); GameSettings.EnableHeroInfo = (PlayerPrefs.GetInt("GameSettings_HeroInfoShowEnable", 1) == 1); GameSettings.HeroSelectHeroViewSortType = (CMallSortHelper.HeroViewSortType)PlayerPrefs.GetInt("GameSettingSelectHeroSortType", 1); int int7 = PlayerPrefs.GetInt("GameSettingEnableReplayKit", 0); GameSettings.EnableReplayKit = (int7 == 1); int int8 = PlayerPrefs.GetInt("GameSettingEnableReplayKitAutoMode", 0); GameSettings.EnableReplayKitAutoMode = (int8 == 1); int int9 = PlayerPrefs.GetInt("GameSettingEnableKingTime", 0); GameSettings.EnableKingTimeMode = (int9 == 1); if (GameSettings.EnableKingTimeMode) { GameSettings.EnableRecorderMode = false; } else { int int10 = PlayerPrefs.GetInt("GameSettingEnableRecorderMode", 0); GameSettings.EnableRecorderMode = (int10 == 1); } GameSettings.EnableOutline = (PlayerPrefs.GetInt("sgameSettings_outline", 0) != 0); GameSettings.TheCastType = (CastType)PlayerPrefs.GetInt("GameSettings_CastType", 1); GameSettings.TheCommonAttackType = (CommonAttactType)PlayerPrefs.GetInt("GameSetting_CommonAttackType", 0); GameSettings.TheSelectType = (SelectEnemyType)PlayerPrefs.GetInt("GameSettings_SelectEnemyType", 1); GameSettings.TheLastHitMode = (LastHitMode)PlayerPrefs.GetInt("GameSetting_LastHitMode", 0); GameSettings.s_lunpanSensitivity = ((!PlayerPrefs.HasKey("GameSettings_LunPanCastSensitivity")) ? 1f : PlayerPrefs.GetFloat("GameSettings_LunPanCastSensitivity", 1f)); GameSettings.TheSkillCancleType = (SkillCancleType)PlayerPrefs.GetInt("GameSettingSkillCancleType", 0); GameSettings.TheCameraMoveType = (CameraMoveType)PlayerPrefs.GetInt("GameSettingCameraMoveType", 0); GameSettings.YaoGanSensitivity = PlayerPrefs.GetFloat("GameSettingCameraYaoGanSensitivity", 25000f); GameSettings.HuaDongSensitivity = PlayerPrefs.GetFloat("GameSettingCameraHuaDongSensitivity", 100f); GameSettings.MusicEffectLevel = ((!PlayerPrefs.HasKey("GameSettingMusicEffectLevel")) ? 100f : PlayerPrefs.GetFloat("GameSettingMusicEffectLevel", 100f)); GameSettings.SoundEffectLevel = ((!PlayerPrefs.HasKey("GameSettingSoundEffectLevel")) ? 100f : PlayerPrefs.GetFloat("GameSettingSoundEffectLevel", 100f)); GameSettings.VoiceEffectLevel = ((!PlayerPrefs.HasKey("GameSettingVoiceEffectLevel")) ? 100f : PlayerPrefs.GetFloat("GameSettingVoiceEffectLevel", 100f)); if (GameSettings.DeviceLevel == SGameRenderQuality.Low) { GameSettings.cameraHeight = CameraHeightType.Low; } else { GameSettings.cameraHeight = CameraHeightType.Medium; } if (PlayerPrefs.HasKey("cameraHeight")) { GameSettings.CameraHeight = PlayerPrefs.GetInt("cameraHeight", 1); } GameSettings.JoyStickMoveType = PlayerPrefs.GetInt("joystickMoveType", 1); GameSettings.JoyStickShowType = PlayerPrefs.GetInt("joystickShowType", 0); GameSettings.FpsShowType = PlayerPrefs.GetInt("str_fpsShowType", 0); GameSettings.m_clickEnableInBattleInputChat = PlayerPrefs.GetInt("str_inBatInputShowType", 1); GameSettings.LunPanLockEnemyHeroMode = (PlayerPrefs.GetInt("GameSettingEnableLunPanLockEnemyHeroMode", 0) == 1); GameSettings.ShowEnemyHeroHeadBtnMode = (PlayerPrefs.GetInt("GameSettingEnableShowEnemyHeroHeadBtnMode", 0) == 1); }
public static void Init() { DeviceLevel = SGameRenderQuality.Low; DeviceLevel = DetectRenderQuality.check_Android(); if (PlayerPrefs.HasKey("sgameSettings_RenderQuality")) { RenderQuality = (SGameRenderQuality)Mathf.Clamp(PlayerPrefs.GetInt("sgameSettings_RenderQuality", 0), 0, 2); } else { RenderQuality = DeviceLevel; } if (PlayerPrefs.HasKey("sgameSettings_ParticleQuality")) { ParticleQuality = (SGameRenderQuality)Mathf.Clamp(PlayerPrefs.GetInt("sgameSettings_ParticleQuality", 0), 0, 2); } else { ParticleQuality = RenderQuality; } EnableSound = PlayerPrefs.GetInt("sgameSettings_muteSound", 1) == 1; EnableMusic = PlayerPrefs.GetInt("sgameSettings_muteMusic", 1) == 1; if (PlayerPrefs.HasKey("sgameSettings_EnableVoice")) { EnableVoice = PlayerPrefs.GetInt("sgameSettings_EnableVoice", 1) == 1; } else { EnableVoice = false; } EnableVibrate = PlayerPrefs.GetInt("GameSettingEnableVibrate", 1) == 1; EnableReplayKit = PlayerPrefs.GetInt("GameSettingEnableReplayKit", 0) == 1; EnableReplayKitAutoMode = PlayerPrefs.GetInt("GameSettingEnableReplayKitAutoMode", 0) == 1; EnableKingTimeMode = PlayerPrefs.GetInt("GameSettingEnableKingTime", 0) == 1; if (EnableKingTimeMode) { EnableRecorderMode = false; } else { EnableRecorderMode = PlayerPrefs.GetInt("GameSettingEnableRecorderMode", 0) == 1; } EnableOutline = PlayerPrefs.GetInt("sgameSettings_outline", 0) != 0; TheCastType = (CastType)PlayerPrefs.GetInt("GameSettings_CastType", 1); TheCommonAttackType = (CommonAttactType)PlayerPrefs.GetInt("GameSetting_CommonAttackType", 0); TheSelectType = (SelectEnemyType)PlayerPrefs.GetInt("GameSettings_SelectEnemyType", 1); s_lunpanSensitivity = !PlayerPrefs.HasKey("GameSettings_LunPanCastSensitivity") ? 1f : PlayerPrefs.GetFloat("GameSettings_LunPanCastSensitivity", 1f); TheSkillCancleType = (SkillCancleType)PlayerPrefs.GetInt("GameSettingSkillCancleType", 0); TheCameraMoveType = (CameraMoveType)PlayerPrefs.GetInt("GameSettingCameraMoveType", 0); YaoGanSensitivity = PlayerPrefs.GetFloat("GameSettingCameraYaoGanSensitivity", 25000f); HuaDongSensitivity = PlayerPrefs.GetFloat("GameSettingCameraHuaDongSensitivity", 100f); MusicEffectLevel = !PlayerPrefs.HasKey("GameSettingMusicEffectLevel") ? 100f : PlayerPrefs.GetFloat("GameSettingMusicEffectLevel", 100f); SoundEffectLevel = !PlayerPrefs.HasKey("GameSettingSoundEffectLevel") ? 100f : PlayerPrefs.GetFloat("GameSettingSoundEffectLevel", 100f); VoiceEffectLevel = !PlayerPrefs.HasKey("GameSettingVoiceEffectLevel") ? 100f : PlayerPrefs.GetFloat("GameSettingVoiceEffectLevel", 100f); if (DeviceLevel == SGameRenderQuality.Low) { cameraHeight = CameraHeightType.Low; } else { cameraHeight = CameraHeightType.Medium; } if (PlayerPrefs.HasKey("cameraHeight")) { CameraHeight = PlayerPrefs.GetInt("cameraHeight", 1); } JoyStickMoveType = PlayerPrefs.GetInt("joystickMoveType", 1); JoyStickShowType = PlayerPrefs.GetInt("joystickShowType", 0); FpsShowType = PlayerPrefs.GetInt("str_fpsShowType", 0); m_clickEnableInBattleInputChat = PlayerPrefs.GetInt("str_inBatInputShowType", 1); }