暂且还原InputResolver的优化

This commit is contained in:
sin365 2025-09-19 16:17:06 +08:00
parent 11a314657d
commit e10d2ce3d2

View File

@ -114,30 +114,30 @@ namespace AxibugEmuOnline.Client.InputDevices
public bool CheckPerforming<CONTROLLER>(CONTROLLER control) where CONTROLLER : InputControl_C
{
//减少遍历开销因为每帧200+次的调用 居然CPU占用了2~3%
if (App.emu?.Core == null || last_CheckPerformingFrameIdx != App.emu.Core.Frame)
{
////减少遍历开销因为每帧200+次的调用 居然CPU占用了2~3%
//if (App.emu?.Core == null || last_CheckPerformingFrameIdx != App.emu.Core.Frame)
//{
// if (control.Device is ScreenGamepad_D)
// {
// ScreenGamepad_D device = control.Device as ScreenGamepad_D;
// last_CheckPerformingValue = device.CheckPerforming(control);
// }
// else last_CheckPerformingValue = OnCheckPerforming(control);
// if (App.emu?.Core != null)
// last_CheckPerformingFrameIdx = App.emu.Core.Frame;
//}
//return last_CheckPerformingValue;
if (control.Device is ScreenGamepad_D)
{
ScreenGamepad_D device = control.Device as ScreenGamepad_D;
last_CheckPerformingValue = device.CheckPerforming(control);
return device.CheckPerforming(control);
}
else last_CheckPerformingValue = OnCheckPerforming(control);
if (App.emu?.Core != null)
last_CheckPerformingFrameIdx = App.emu.Core.Frame;
}
return last_CheckPerformingValue;
//if (control.Device is ScreenGamepad_D)
//{
// ScreenGamepad_D device = control.Device as ScreenGamepad_D;
// return device.CheckPerforming(control);
//}
//else return OnCheckPerforming(control);
else return OnCheckPerforming(control);
}
protected abstract bool OnCheckPerforming<CONTROLLER>(CONTROLLER control) where CONTROLLER : InputControl_C;