forked from sin365/AxibugEmuOnline
暂且还原InputResolver的优化
This commit is contained in:
parent
11a314657d
commit
e10d2ce3d2
@ -114,30 +114,30 @@ namespace AxibugEmuOnline.Client.InputDevices
|
|||||||
|
|
||||||
public bool CheckPerforming<CONTROLLER>(CONTROLLER control) where CONTROLLER : InputControl_C
|
public bool CheckPerforming<CONTROLLER>(CONTROLLER control) where CONTROLLER : InputControl_C
|
||||||
{
|
{
|
||||||
//减少遍历开销,因为每帧200+次的调用 居然CPU占用了2~3%
|
////减少遍历开销,因为每帧200+次的调用 居然CPU占用了2~3%
|
||||||
if (App.emu?.Core == null || last_CheckPerformingFrameIdx != App.emu.Core.Frame)
|
//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)
|
// if (control.Device is ScreenGamepad_D)
|
||||||
// {
|
// {
|
||||||
// ScreenGamepad_D device = control.Device as ScreenGamepad_D;
|
// ScreenGamepad_D device = control.Device as ScreenGamepad_D;
|
||||||
|
|
||||||
// return device.CheckPerforming(control);
|
// last_CheckPerformingValue = device.CheckPerforming(control);
|
||||||
// }
|
// }
|
||||||
//else return OnCheckPerforming(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);
|
||||||
}
|
}
|
||||||
protected abstract bool OnCheckPerforming<CONTROLLER>(CONTROLLER control) where CONTROLLER : InputControl_C;
|
protected abstract bool OnCheckPerforming<CONTROLLER>(CONTROLLER control) where CONTROLLER : InputControl_C;
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user