mirror of
https://github.com/soarqin/DSP_Mods.git
synced 2025-12-09 06:13:36 +08:00
reformat code
This commit is contained in:
@@ -204,16 +204,11 @@ public static class WinApi
|
|||||||
[StructLayout(LayoutKind.Explicit)]
|
[StructLayout(LayoutKind.Explicit)]
|
||||||
public struct SYSTEM_LOGICAL_PROCESSOR_INFORMATION_UNION
|
public struct SYSTEM_LOGICAL_PROCESSOR_INFORMATION_UNION
|
||||||
{
|
{
|
||||||
[FieldOffset(0)]
|
[FieldOffset(0)] public PROCESSORCORE ProcessorCore;
|
||||||
public PROCESSORCORE ProcessorCore;
|
[FieldOffset(0)] public NUMANODE NumaNode;
|
||||||
[FieldOffset(0)]
|
[FieldOffset(0)] public CACHE_DESCRIPTOR Cache;
|
||||||
public NUMANODE NumaNode;
|
[FieldOffset(0)] private UInt64 Reserved1;
|
||||||
[FieldOffset(0)]
|
[FieldOffset(8)] private UInt64 Reserved2;
|
||||||
public CACHE_DESCRIPTOR Cache;
|
|
||||||
[FieldOffset(0)]
|
|
||||||
private UInt64 Reserved1;
|
|
||||||
[FieldOffset(8)]
|
|
||||||
private UInt64 Reserved2;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public struct SYSTEM_LOGICAL_PROCESSOR_INFORMATION
|
public struct SYSTEM_LOGICAL_PROCESSOR_INFORMATION
|
||||||
@@ -223,7 +218,7 @@ public static class WinApi
|
|||||||
public SYSTEM_LOGICAL_PROCESSOR_INFORMATION_UNION ProcessorInformation;
|
public SYSTEM_LOGICAL_PROCESSOR_INFORMATION_UNION ProcessorInformation;
|
||||||
}
|
}
|
||||||
|
|
||||||
[DllImport(@"kernel32", SetLastError=true)]
|
[DllImport(@"kernel32", SetLastError = true)]
|
||||||
private static extern bool GetLogicalProcessorInformation(
|
private static extern bool GetLogicalProcessorInformation(
|
||||||
IntPtr buffer,
|
IntPtr buffer,
|
||||||
ref uint returnLength
|
ref uint returnLength
|
||||||
@@ -264,12 +259,12 @@ public static class WinApi
|
|||||||
result.ThreadCount += tcount;
|
result.ThreadCount += tcount;
|
||||||
if (tcount > 1)
|
if (tcount > 1)
|
||||||
{
|
{
|
||||||
result.PerformanceCoreCount ++;
|
result.PerformanceCoreCount++;
|
||||||
result.PerformanceCoreMask |= (ulong)buffer.ProcessorMask;
|
result.PerformanceCoreMask |= (ulong)buffer.ProcessorMask;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
result.EfficiencyCoreCount ++;
|
result.EfficiencyCoreCount++;
|
||||||
result.EfficiencyCoreMask |= (ulong)buffer.ProcessorMask;
|
result.EfficiencyCoreMask |= (ulong)buffer.ProcessorMask;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -278,6 +273,7 @@ public static class WinApi
|
|||||||
{
|
{
|
||||||
Marshal.FreeHGlobal(ptr);
|
Marshal.FreeHGlobal(ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
int CountBitsSet(ulong mask)
|
int CountBitsSet(ulong mask)
|
||||||
@@ -288,6 +284,7 @@ public static class WinApi
|
|||||||
mask &= mask - 1;
|
mask &= mask - 1;
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -113,6 +113,7 @@ public static class WindowFunctions
|
|||||||
{
|
{
|
||||||
WinApi.SetWindowLongPtr(_gameWindowHandle, WinApi.GWLP_WNDPROC, _oldWndProc);
|
WinApi.SetWindowLongPtr(_gameWindowHandle, WinApi.GWLP_WNDPROC, _oldWndProc);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case WinApi.WM_SYSCOMMAND:
|
case WinApi.WM_SYSCOMMAND:
|
||||||
switch ((long)wParam & 0xFFF0L)
|
switch ((long)wParam & 0xFFF0L)
|
||||||
@@ -121,6 +122,7 @@ public static class WindowFunctions
|
|||||||
if (GamePatch.LoadLastWindowRectEnabled.Value && !_gameLoaded) return (IntPtr)1L;
|
if (GamePatch.LoadLastWindowRectEnabled.Value && !_gameLoaded) return (IntPtr)1L;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case WinApi.WM_MOVING:
|
case WinApi.WM_MOVING:
|
||||||
if (!GamePatch.LoadLastWindowRectEnabled.Value || _gameLoaded) break;
|
if (!GamePatch.LoadLastWindowRectEnabled.Value || _gameLoaded) break;
|
||||||
@@ -149,6 +151,7 @@ public static class WindowFunctions
|
|||||||
Marshal.StructureToPtr(rect2, lParam, false);
|
Marshal.StructureToPtr(rect2, lParam, false);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return WinApi.CallWindowProc(_oldWndProc, hWnd, uMsg, wParam, lParam);
|
return WinApi.CallWindowProc(_oldWndProc, hWnd, uMsg, wParam, lParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -253,6 +256,7 @@ public static class WindowFunctions
|
|||||||
if (pid == currentProcessId)
|
if (pid == currentProcessId)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
_gameWindowHandle = wnd;
|
_gameWindowHandle = wnd;
|
||||||
return _gameWindowHandle;
|
return _gameWindowHandle;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user