mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-08-20 09:57:09 +00:00
Revert "Call SetProcessDpiAwareness via GetProcAddress to preserve Windows 7 compatibility"
This reverts commit f1f397fdbe.
This commit is contained in:
parent
f1f397fdbe
commit
e0779be14f
|
|
@ -54,6 +54,7 @@ target_link_libraries(MinecraftClient PRIVATE
|
||||||
MinecraftWorld
|
MinecraftWorld
|
||||||
d3d11
|
d3d11
|
||||||
XInput9_1_0
|
XInput9_1_0
|
||||||
|
Shcore
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Client/Windows64/Iggy/lib/iggy_w64.lib"
|
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Client/Windows64/Iggy/lib/iggy_w64.lib"
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Client/Windows64/Miles/lib/mss64.lib"
|
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Client/Windows64/Miles/lib/mss64.lib"
|
||||||
$<$<CONFIG:Debug>:
|
$<$<CONFIG:Debug>:
|
||||||
|
|
|
||||||
|
|
@ -1296,7 +1296,7 @@ if not exist "$(TargetDir)\savedata" mkdir "$(TargetDir)\savedata"</Command>
|
||||||
<Link>
|
<Link>
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
<ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>
|
<ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>
|
||||||
<AdditionalDependencies>d3d11.lib;..\Minecraft.World\x64_Debug\Minecraft.World.lib;%(AdditionalDependencies);XInput9_1_0.lib;..\Minecraft.Client\Windows64\Miles\Lib\mss64.lib</AdditionalDependencies>
|
<AdditionalDependencies>d3d11.lib;Shcore.lib;..\Minecraft.World\x64_Debug\Minecraft.World.lib;%(AdditionalDependencies);XInput9_1_0.lib;..\Minecraft.Client\Windows64\Miles\Lib\mss64.lib</AdditionalDependencies>
|
||||||
<ShowProgress>NotSet</ShowProgress>
|
<ShowProgress>NotSet</ShowProgress>
|
||||||
<SuppressStartupBanner>false</SuppressStartupBanner>
|
<SuppressStartupBanner>false</SuppressStartupBanner>
|
||||||
<ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>
|
<ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>
|
||||||
|
|
@ -1429,7 +1429,7 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
|
||||||
<Link>
|
<Link>
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
<ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>
|
<ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>
|
||||||
<AdditionalDependencies>d3d11.lib;..\Minecraft.World\x64_Release\Minecraft.World.lib;XInput9_1_0.lib;Windows64\Iggy\lib\iggy_w64.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<AdditionalDependencies>d3d11.lib;Shcore.lib;..\Minecraft.World\x64_Release\Minecraft.World.lib;XInput9_1_0.lib;Windows64\Iggy\lib\iggy_w64.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
<ShowProgress>NotSet</ShowProgress>
|
<ShowProgress>NotSet</ShowProgress>
|
||||||
<SuppressStartupBanner>false</SuppressStartupBanner>
|
<SuppressStartupBanner>false</SuppressStartupBanner>
|
||||||
</Link>
|
</Link>
|
||||||
|
|
@ -1474,7 +1474,7 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
|
||||||
<Link>
|
<Link>
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
<ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>
|
<ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>
|
||||||
<AdditionalDependencies>d3d11.lib;..\Minecraft.World\x64_Release\Minecraft.World.lib;XInput9_1_0.lib;Windows64\Iggy\lib\iggy_w64.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<AdditionalDependencies>d3d11.lib;Shcore.lib;..\Minecraft.World\x64_Release\Minecraft.World.lib;XInput9_1_0.lib;Windows64\Iggy\lib\iggy_w64.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
<ShowProgress>NotSet</ShowProgress>
|
<ShowProgress>NotSet</ShowProgress>
|
||||||
<SuppressStartupBanner>false</SuppressStartupBanner>
|
<SuppressStartupBanner>false</SuppressStartupBanner>
|
||||||
</Link>
|
</Link>
|
||||||
|
|
|
||||||
|
|
@ -707,19 +707,6 @@ void CleanupDevice()
|
||||||
if( g_pd3dDevice ) g_pd3dDevice->Release();
|
if( g_pd3dDevice ) g_pd3dDevice->Release();
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef HRESULT(__stdcall* SetProcessDpiAwareness_f)(PROCESS_DPI_AWARENESS);
|
|
||||||
static HRESULT dyn_SetProcessDpiAwareness(PROCESS_DPI_AWARENESS value)
|
|
||||||
{
|
|
||||||
static const auto ptr = reinterpret_cast<SetProcessDpiAwareness_f>(
|
|
||||||
reinterpret_cast<void*>(::GetProcAddress(static_cast<HMODULE>(LoadLibraryExW(L"Shcore.dll", nullptr, 0)), "SetProcessDpiAwareness")));
|
|
||||||
if (ptr == nullptr)
|
|
||||||
{
|
|
||||||
::SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
|
||||||
return E_NOTIMPL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return ptr(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
|
int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
|
||||||
|
|
@ -730,7 +717,7 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
|
||||||
UNREFERENCED_PARAMETER(hPrevInstance);
|
UNREFERENCED_PARAMETER(hPrevInstance);
|
||||||
UNREFERENCED_PARAMETER(lpCmdLine);
|
UNREFERENCED_PARAMETER(lpCmdLine);
|
||||||
|
|
||||||
dyn_SetProcessDpiAwareness(PROCESS_PER_MONITOR_DPI_AWARE);
|
SetProcessDpiAwareness(PROCESS_PER_MONITOR_DPI_AWARE);
|
||||||
g_iScreenWidth = GetSystemMetrics(SM_CXSCREEN);
|
g_iScreenWidth = GetSystemMetrics(SM_CXSCREEN);
|
||||||
g_iScreenHeight = GetSystemMetrics(SM_CYSCREEN);
|
g_iScreenHeight = GetSystemMetrics(SM_CYSCREEN);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue