干掉管理层逻辑GC

This commit is contained in:
sin365 2025-09-17 10:17:55 +08:00
parent acf1071ea2
commit 81ec8e4879
5 changed files with 31 additions and 15 deletions

View File

@ -51,7 +51,7 @@ namespace AxibugEmuOnline.Client.Settings
{ {
//获得激活的滤镜 //获得激活的滤镜
Filter activeFilter = null; Filter activeFilter = null;
foreach (var filter in Filters) foreach (var filter in m_filters)
{ {
if (!filter.m_setting.Enable) continue; if (!filter.m_setting.Enable) continue;
activeFilter = filter; activeFilter = filter;
@ -83,13 +83,16 @@ namespace AxibugEmuOnline.Client.Settings
renderGraphic.texture = result; renderGraphic.texture = result;
} }
// 获取 RawImage 在屏幕上的四个顶点的世界坐标
Vector3[] corners = new Vector3[4];
Vector2 GetRawImageScreenResolution(RawImage rawImage) Vector2 GetRawImageScreenResolution(RawImage rawImage)
{ {
// 获取 RawImage 的 RectTransform // 获取 RawImage 的 RectTransform
RectTransform rectTransform = rawImage.rectTransform; RectTransform rectTransform = rawImage.rectTransform;
for (int i = 0; i < corners.Length; i++)
// 获取 RawImage 在屏幕上的四个顶点的世界坐标 {
Vector3[] corners = new Vector3[4]; corners[0] = Vector3.zero;
}
rectTransform.GetWorldCorners(corners); rectTransform.GetWorldCorners(corners);
// 左下角和右上角的屏幕坐标 // 左下角和右上角的屏幕坐标
@ -124,7 +127,7 @@ namespace AxibugEmuOnline.Client.Settings
/// <param name="filter"></param> /// <param name="filter"></param>
public void EnableFilter(Filter filter) public void EnableFilter(Filter filter)
{ {
foreach (var selfFiler in Filters) foreach (var selfFiler in m_filters)
{ {
if (selfFiler != filter) selfFiler.m_setting.Enable = false; if (selfFiler != filter) selfFiler.m_setting.Enable = false;
else selfFiler.m_setting.Enable = true; else selfFiler.m_setting.Enable = true;
@ -137,7 +140,7 @@ namespace AxibugEmuOnline.Client.Settings
public void ShutDownFilter() public void ShutDownFilter()
{ {
//关闭所有后处理效果 //关闭所有后处理效果
foreach (var filter in Filters) foreach (var filter in m_filters)
filter.m_setting.Enable = false; filter.m_setting.Enable = false;
} }

View File

@ -285,7 +285,7 @@ public abstract class EmuCoreBinder<T> : InternalEmuCoreBinder,
} }
private List<InputControl_C> m_caches = new List<InputControl_C>(); private List<InputControl_C> m_caches = new List<InputControl_C>();
public IEnumerable<InputControl_C> GetBinding(T emuBtn) public List<InputControl_C> GetBinding(T emuBtn)
{ {
m_caches.Clear(); m_caches.Clear();

View File

@ -1,4 +1,5 @@
using AxibugProtobuf; using AxibugProtobuf;
using System.Collections.Generic;
using UnityEngine; using UnityEngine;
using UnityEngine.UI; using UnityEngine.UI;
@ -9,13 +10,25 @@ namespace AxibugEmuOnline.Client.Settings
/// </summary> /// </summary>
public class ScreenScaler public class ScreenScaler
{ {
string key_GlobalMode = nameof(ScreenScaler) + ".GlobalMode";
Dictionary<RomPlatformType, string> cache_PlatMode = new Dictionary<RomPlatformType, string>();
string get_key_PlatMode(RomPlatformType platform) {
if (cache_PlatMode.ContainsKey(platform))
return cache_PlatMode[platform];
string val = nameof(ScreenScaler)+".PlatMode." + platform;
cache_PlatMode[platform] = val;
return val;
}
/// <summary> /// <summary>
/// 全局设置的缩放模式 /// 全局设置的缩放模式
/// </summary> /// </summary>
public EnumScalerMode GlobalMode public EnumScalerMode GlobalMode
{ {
get => (EnumScalerMode)AxiPlayerPrefs.GetInt($"{nameof(ScreenScaler)}.GlobalMode", 0); //get => (EnumScalerMode)AxiPlayerPrefs.GetInt($"{nameof(ScreenScaler)}.GlobalMode", 0);
set => AxiPlayerPrefs.SetInt($"{nameof(ScreenScaler)}.GlobalMode", (int)value); //set => AxiPlayerPrefs.SetInt($"{nameof(ScreenScaler)}.GlobalMode", (int)value);
get => (EnumScalerMode)AxiPlayerPrefs.GetInt(key_GlobalMode, 0);
set => AxiPlayerPrefs.SetInt(key_GlobalMode, (int)value);
} }
/// <summary> /// <summary>
@ -25,7 +38,7 @@ namespace AxibugEmuOnline.Client.Settings
/// <returns></returns> /// <returns></returns>
public EnumScalerMode GetMode(RomPlatformType platform) public EnumScalerMode GetMode(RomPlatformType platform)
{ {
int setVal = AxiPlayerPrefs.GetInt($"{nameof(ScreenScaler)}.PlatMode.{platform}", -1); int setVal = AxiPlayerPrefs.GetInt(get_key_PlatMode(platform), -1);
if (setVal == -1) if (setVal == -1)
return GlobalMode; return GlobalMode;
else else
@ -34,14 +47,14 @@ namespace AxibugEmuOnline.Client.Settings
public bool IsSetMode(RomPlatformType platform) public bool IsSetMode(RomPlatformType platform)
{ {
int setVal = AxiPlayerPrefs.GetInt($"{nameof(ScreenScaler)}.PlatMode.{platform}", -1); int setVal = AxiPlayerPrefs.GetInt(get_key_PlatMode(platform), -1);
return setVal != -1; return setVal != -1;
} }
public void SetMode(RomPlatformType platform, EnumScalerMode? mode) public void SetMode(RomPlatformType platform, EnumScalerMode? mode)
{ {
int setVal = mode == null ? -1 : (int)mode; int setVal = mode == null ? -1 : (int)mode;
AxiPlayerPrefs.SetInt($"{nameof(ScreenScaler)}.PlatMode.{platform}", setVal); AxiPlayerPrefs.SetInt(get_key_PlatMode(platform), setVal);
} }
/// <summary> /// <summary>

View File

@ -52,7 +52,7 @@ namespace AxibugEmuOnline.Client.InputDevices
/// 获得所有当前已连入的输入设备 /// 获得所有当前已连入的输入设备
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
public IEnumerable<InputDevice_D> GetDevices() public List<InputDevice_D> GetDevices()
{ {
m_devicesResultCache.Clear(); m_devicesResultCache.Clear();
m_devicesResultCache.AddRange(m_devices.Values); m_devicesResultCache.AddRange(m_devices.Values);

View File

@ -19,7 +19,7 @@ namespace AxibugEmuOnline.Client
m_checkCmds = Enum.GetValues(typeof(EnumCommand)) as EnumCommand[]; m_checkCmds = Enum.GetValues(typeof(EnumCommand)) as EnumCommand[];
} }
IEnumerable<CommandState> GetCommand() List<CommandState> GetCommand()
{ {
if (CheckFrame == Time.frameCount) if (CheckFrame == Time.frameCount)
return m_commands; return m_commands;
@ -39,7 +39,7 @@ namespace AxibugEmuOnline.Client
return m_commands; return m_commands;
} }
public void Update(IEnumerable<CommandExecuter> executers) public void Update(List<CommandExecuter> executers)
{ {
foreach (var cmd in GetCommand()) foreach (var cmd in GetCommand())
{ {