1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-06-27 23:14:05 +00:00

stripped unneeded files and changed default config options

This commit is contained in:
Blake Warner 2022-01-29 17:51:08 -05:00
parent 0255e10db6
commit a054cb622b
148 changed files with 143 additions and 84839 deletions

View File

@ -1,6 +1,7 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30413.136
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GLideN64", "GLideN64.vcxproj", "{37D31D7F-C4E7-45B0-AEF6-D6824A243CF7}"
ProjectSection(ProjectDependencies) = postProject
@ -12,172 +13,44 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libGLideNHQ", "libGLideNHQ.
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "osal", "osal.vcxproj", "{7BF6F100-31DB-44AE-A2A5-5DDEED9A909C}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GLideNUI", "GLideNUI.vcxproj", "{37CAB375-A7A6-3CAB-BD56-0E954D3FD2FE}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GLideNUI-wtl", "GLideNUI-wtl.vcxproj", "{9E05B70F-A294-44A9-A151-B2CC95AA884E}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ticpp", "ticpp.vcxproj", "{4F28B56B-F4B0-41B0-A785-597F6EF0163A}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ts2lang", "ts2lang.vcxproj", "{5480BC17-9C40-4E41-8AD4-AE12316D4CA4}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug_mupenplus|Win32 = Debug_mupenplus|Win32
Debug_mupenplus|x64 = Debug_mupenplus|x64
Debug_qt|Win32 = Debug_qt|Win32
Debug_qt|x64 = Debug_qt|x64
Debug_wtl|Win32 = Debug_wtl|Win32
Debug_wtl|x64 = Debug_wtl|x64
Release_mupenplus|Win32 = Release_mupenplus|Win32
Release_mupenplus|x64 = Release_mupenplus|x64
Release_qt|Win32 = Release_qt|Win32
Release_qt|x64 = Release_qt|x64
Release_wtl|Win32 = Release_wtl|Win32
Release_wtl|x64 = Release_wtl|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{37D31D7F-C4E7-45B0-AEF6-D6824A243CF7}.Debug_mupenplus|Win32.ActiveCfg = Debug_mupenplus|Win32
{37D31D7F-C4E7-45B0-AEF6-D6824A243CF7}.Debug_mupenplus|Win32.Build.0 = Debug_mupenplus|Win32
{37D31D7F-C4E7-45B0-AEF6-D6824A243CF7}.Debug_mupenplus|x64.ActiveCfg = Debug_mupenplus|x64
{37D31D7F-C4E7-45B0-AEF6-D6824A243CF7}.Debug_mupenplus|x64.Build.0 = Debug_mupenplus|x64
{37D31D7F-C4E7-45B0-AEF6-D6824A243CF7}.Debug_qt|Win32.ActiveCfg = Debug_qt|Win32
{37D31D7F-C4E7-45B0-AEF6-D6824A243CF7}.Debug_qt|Win32.Build.0 = Debug_qt|Win32
{37D31D7F-C4E7-45B0-AEF6-D6824A243CF7}.Debug_qt|x64.ActiveCfg = Debug_qt|x64
{37D31D7F-C4E7-45B0-AEF6-D6824A243CF7}.Debug_qt|x64.Build.0 = Debug_qt|x64
{37D31D7F-C4E7-45B0-AEF6-D6824A243CF7}.Debug_wtl|Win32.ActiveCfg = Debug_wtl|Win32
{37D31D7F-C4E7-45B0-AEF6-D6824A243CF7}.Debug_wtl|Win32.Build.0 = Debug_wtl|Win32
{37D31D7F-C4E7-45B0-AEF6-D6824A243CF7}.Debug_wtl|x64.ActiveCfg = Debug_wtl|x64
{37D31D7F-C4E7-45B0-AEF6-D6824A243CF7}.Debug_wtl|x64.Build.0 = Debug_wtl|x64
{37D31D7F-C4E7-45B0-AEF6-D6824A243CF7}.Release_mupenplus|Win32.ActiveCfg = Release_mupenplus|Win32
{37D31D7F-C4E7-45B0-AEF6-D6824A243CF7}.Release_mupenplus|Win32.Build.0 = Release_mupenplus|Win32
{37D31D7F-C4E7-45B0-AEF6-D6824A243CF7}.Release_mupenplus|x64.ActiveCfg = Release_mupenplus|x64
{37D31D7F-C4E7-45B0-AEF6-D6824A243CF7}.Release_mupenplus|x64.Build.0 = Release_mupenplus|x64
{37D31D7F-C4E7-45B0-AEF6-D6824A243CF7}.Release_qt|Win32.ActiveCfg = Release_qt|Win32
{37D31D7F-C4E7-45B0-AEF6-D6824A243CF7}.Release_qt|Win32.Build.0 = Release_qt|Win32
{37D31D7F-C4E7-45B0-AEF6-D6824A243CF7}.Release_qt|x64.ActiveCfg = Release_qt|x64
{37D31D7F-C4E7-45B0-AEF6-D6824A243CF7}.Release_qt|x64.Build.0 = Release_qt|x64
{37D31D7F-C4E7-45B0-AEF6-D6824A243CF7}.Release_wtl|Win32.ActiveCfg = Release_wtl|Win32
{37D31D7F-C4E7-45B0-AEF6-D6824A243CF7}.Release_wtl|Win32.Build.0 = Release_wtl|Win32
{37D31D7F-C4E7-45B0-AEF6-D6824A243CF7}.Release_wtl|x64.ActiveCfg = Release_wtl|x64
{37D31D7F-C4E7-45B0-AEF6-D6824A243CF7}.Release_wtl|x64.Build.0 = Release_wtl|x64
{DA965BCF-2219-47AF-ACE7-EAF76D5D4756}.Debug_mupenplus|Win32.ActiveCfg = Debug|Win32
{DA965BCF-2219-47AF-ACE7-EAF76D5D4756}.Debug_mupenplus|Win32.Build.0 = Debug|Win32
{DA965BCF-2219-47AF-ACE7-EAF76D5D4756}.Debug_mupenplus|x64.ActiveCfg = Debug|x64
{DA965BCF-2219-47AF-ACE7-EAF76D5D4756}.Debug_mupenplus|x64.Build.0 = Debug|x64
{DA965BCF-2219-47AF-ACE7-EAF76D5D4756}.Debug_qt|Win32.ActiveCfg = Debug|Win32
{DA965BCF-2219-47AF-ACE7-EAF76D5D4756}.Debug_qt|Win32.Build.0 = Debug|Win32
{DA965BCF-2219-47AF-ACE7-EAF76D5D4756}.Debug_qt|x64.ActiveCfg = Debug|x64
{DA965BCF-2219-47AF-ACE7-EAF76D5D4756}.Debug_qt|x64.Build.0 = Debug|x64
{DA965BCF-2219-47AF-ACE7-EAF76D5D4756}.Debug_wtl|Win32.ActiveCfg = Debug|Win32
{DA965BCF-2219-47AF-ACE7-EAF76D5D4756}.Debug_wtl|Win32.Build.0 = Debug|Win32
{DA965BCF-2219-47AF-ACE7-EAF76D5D4756}.Debug_wtl|x64.ActiveCfg = Debug|x64
{DA965BCF-2219-47AF-ACE7-EAF76D5D4756}.Debug_wtl|x64.Build.0 = Debug|x64
{DA965BCF-2219-47AF-ACE7-EAF76D5D4756}.Release_mupenplus|Win32.ActiveCfg = Release|Win32
{DA965BCF-2219-47AF-ACE7-EAF76D5D4756}.Release_mupenplus|Win32.Build.0 = Release|Win32
{DA965BCF-2219-47AF-ACE7-EAF76D5D4756}.Release_mupenplus|x64.ActiveCfg = Release|x64
{DA965BCF-2219-47AF-ACE7-EAF76D5D4756}.Release_mupenplus|x64.Build.0 = Release|x64
{DA965BCF-2219-47AF-ACE7-EAF76D5D4756}.Release_qt|Win32.ActiveCfg = Release|Win32
{DA965BCF-2219-47AF-ACE7-EAF76D5D4756}.Release_qt|Win32.Build.0 = Release|Win32
{DA965BCF-2219-47AF-ACE7-EAF76D5D4756}.Release_qt|x64.ActiveCfg = Release|x64
{DA965BCF-2219-47AF-ACE7-EAF76D5D4756}.Release_qt|x64.Build.0 = Release|x64
{DA965BCF-2219-47AF-ACE7-EAF76D5D4756}.Release_wtl|Win32.ActiveCfg = Release|Win32
{DA965BCF-2219-47AF-ACE7-EAF76D5D4756}.Release_wtl|Win32.Build.0 = Release|Win32
{DA965BCF-2219-47AF-ACE7-EAF76D5D4756}.Release_wtl|x64.ActiveCfg = Release|x64
{DA965BCF-2219-47AF-ACE7-EAF76D5D4756}.Release_wtl|x64.Build.0 = Release|x64
{7BF6F100-31DB-44AE-A2A5-5DDEED9A909C}.Debug_mupenplus|Win32.ActiveCfg = Debug|Win32
{7BF6F100-31DB-44AE-A2A5-5DDEED9A909C}.Debug_mupenplus|Win32.Build.0 = Debug|Win32
{7BF6F100-31DB-44AE-A2A5-5DDEED9A909C}.Debug_mupenplus|x64.ActiveCfg = Debug|x64
{7BF6F100-31DB-44AE-A2A5-5DDEED9A909C}.Debug_mupenplus|x64.Build.0 = Debug|x64
{7BF6F100-31DB-44AE-A2A5-5DDEED9A909C}.Debug_qt|Win32.ActiveCfg = Debug|Win32
{7BF6F100-31DB-44AE-A2A5-5DDEED9A909C}.Debug_qt|Win32.Build.0 = Debug|Win32
{7BF6F100-31DB-44AE-A2A5-5DDEED9A909C}.Debug_qt|x64.ActiveCfg = Debug|x64
{7BF6F100-31DB-44AE-A2A5-5DDEED9A909C}.Debug_qt|x64.Build.0 = Debug|x64
{7BF6F100-31DB-44AE-A2A5-5DDEED9A909C}.Debug_wtl|Win32.ActiveCfg = Debug|Win32
{7BF6F100-31DB-44AE-A2A5-5DDEED9A909C}.Debug_wtl|Win32.Build.0 = Debug|Win32
{7BF6F100-31DB-44AE-A2A5-5DDEED9A909C}.Debug_wtl|x64.ActiveCfg = Debug|x64
{7BF6F100-31DB-44AE-A2A5-5DDEED9A909C}.Debug_wtl|x64.Build.0 = Debug|x64
{7BF6F100-31DB-44AE-A2A5-5DDEED9A909C}.Release_mupenplus|Win32.ActiveCfg = Release|Win32
{7BF6F100-31DB-44AE-A2A5-5DDEED9A909C}.Release_mupenplus|Win32.Build.0 = Release|Win32
{7BF6F100-31DB-44AE-A2A5-5DDEED9A909C}.Release_mupenplus|x64.ActiveCfg = Release|x64
{7BF6F100-31DB-44AE-A2A5-5DDEED9A909C}.Release_mupenplus|x64.Build.0 = Release|x64
{7BF6F100-31DB-44AE-A2A5-5DDEED9A909C}.Release_qt|Win32.ActiveCfg = Release|Win32
{7BF6F100-31DB-44AE-A2A5-5DDEED9A909C}.Release_qt|Win32.Build.0 = Release|Win32
{7BF6F100-31DB-44AE-A2A5-5DDEED9A909C}.Release_qt|x64.ActiveCfg = Release|x64
{7BF6F100-31DB-44AE-A2A5-5DDEED9A909C}.Release_qt|x64.Build.0 = Release|x64
{7BF6F100-31DB-44AE-A2A5-5DDEED9A909C}.Release_wtl|Win32.ActiveCfg = Release|Win32
{7BF6F100-31DB-44AE-A2A5-5DDEED9A909C}.Release_wtl|Win32.Build.0 = Release|Win32
{7BF6F100-31DB-44AE-A2A5-5DDEED9A909C}.Release_wtl|x64.ActiveCfg = Release|x64
{7BF6F100-31DB-44AE-A2A5-5DDEED9A909C}.Release_wtl|x64.Build.0 = Release|x64
{37CAB375-A7A6-3CAB-BD56-0E954D3FD2FE}.Debug_mupenplus|Win32.ActiveCfg = Debug|Win32
{37CAB375-A7A6-3CAB-BD56-0E954D3FD2FE}.Debug_mupenplus|x64.ActiveCfg = Debug|x64
{37CAB375-A7A6-3CAB-BD56-0E954D3FD2FE}.Debug_qt|Win32.ActiveCfg = Debug|Win32
{37CAB375-A7A6-3CAB-BD56-0E954D3FD2FE}.Debug_qt|Win32.Build.0 = Debug|Win32
{37CAB375-A7A6-3CAB-BD56-0E954D3FD2FE}.Debug_qt|x64.ActiveCfg = Debug|x64
{37CAB375-A7A6-3CAB-BD56-0E954D3FD2FE}.Debug_qt|x64.Build.0 = Debug|x64
{37CAB375-A7A6-3CAB-BD56-0E954D3FD2FE}.Debug_wtl|Win32.ActiveCfg = Debug|Win32
{37CAB375-A7A6-3CAB-BD56-0E954D3FD2FE}.Debug_wtl|x64.ActiveCfg = Debug|x64
{37CAB375-A7A6-3CAB-BD56-0E954D3FD2FE}.Release_mupenplus|Win32.ActiveCfg = Release|Win32
{37CAB375-A7A6-3CAB-BD56-0E954D3FD2FE}.Release_mupenplus|x64.ActiveCfg = Release|x64
{37CAB375-A7A6-3CAB-BD56-0E954D3FD2FE}.Release_qt|Win32.ActiveCfg = Release|Win32
{37CAB375-A7A6-3CAB-BD56-0E954D3FD2FE}.Release_qt|Win32.Build.0 = Release|Win32
{37CAB375-A7A6-3CAB-BD56-0E954D3FD2FE}.Release_qt|x64.ActiveCfg = Release|x64
{37CAB375-A7A6-3CAB-BD56-0E954D3FD2FE}.Release_qt|x64.Build.0 = Release|x64
{37CAB375-A7A6-3CAB-BD56-0E954D3FD2FE}.Release_wtl|Win32.ActiveCfg = Release|Win32
{37CAB375-A7A6-3CAB-BD56-0E954D3FD2FE}.Release_wtl|x64.ActiveCfg = Release|x64
{9E05B70F-A294-44A9-A151-B2CC95AA884E}.Debug_mupenplus|Win32.ActiveCfg = Debug|Win32
{9E05B70F-A294-44A9-A151-B2CC95AA884E}.Debug_mupenplus|x64.ActiveCfg = Debug|x64
{9E05B70F-A294-44A9-A151-B2CC95AA884E}.Debug_qt|Win32.ActiveCfg = Debug|Win32
{9E05B70F-A294-44A9-A151-B2CC95AA884E}.Debug_qt|x64.ActiveCfg = Debug|x64
{9E05B70F-A294-44A9-A151-B2CC95AA884E}.Debug_wtl|Win32.ActiveCfg = Debug|Win32
{9E05B70F-A294-44A9-A151-B2CC95AA884E}.Debug_wtl|Win32.Build.0 = Debug|Win32
{9E05B70F-A294-44A9-A151-B2CC95AA884E}.Debug_wtl|x64.ActiveCfg = Debug|x64
{9E05B70F-A294-44A9-A151-B2CC95AA884E}.Debug_wtl|x64.Build.0 = Debug|x64
{9E05B70F-A294-44A9-A151-B2CC95AA884E}.Release_mupenplus|Win32.ActiveCfg = Release|Win32
{9E05B70F-A294-44A9-A151-B2CC95AA884E}.Release_mupenplus|x64.ActiveCfg = Release|x64
{9E05B70F-A294-44A9-A151-B2CC95AA884E}.Release_qt|Win32.ActiveCfg = Release|Win32
{9E05B70F-A294-44A9-A151-B2CC95AA884E}.Release_qt|x64.ActiveCfg = Release|x64
{9E05B70F-A294-44A9-A151-B2CC95AA884E}.Release_wtl|Win32.ActiveCfg = Release|Win32
{9E05B70F-A294-44A9-A151-B2CC95AA884E}.Release_wtl|Win32.Build.0 = Release|Win32
{9E05B70F-A294-44A9-A151-B2CC95AA884E}.Release_wtl|x64.ActiveCfg = Release|x64
{9E05B70F-A294-44A9-A151-B2CC95AA884E}.Release_wtl|x64.Build.0 = Release|x64
{4F28B56B-F4B0-41B0-A785-597F6EF0163A}.Debug_mupenplus|Win32.ActiveCfg = Debug|Win32
{4F28B56B-F4B0-41B0-A785-597F6EF0163A}.Debug_mupenplus|x64.ActiveCfg = Debug|x64
{4F28B56B-F4B0-41B0-A785-597F6EF0163A}.Debug_qt|Win32.ActiveCfg = Debug|Win32
{4F28B56B-F4B0-41B0-A785-597F6EF0163A}.Debug_qt|x64.ActiveCfg = Debug|x64
{4F28B56B-F4B0-41B0-A785-597F6EF0163A}.Debug_wtl|Win32.ActiveCfg = Debug|Win32
{4F28B56B-F4B0-41B0-A785-597F6EF0163A}.Debug_wtl|Win32.Build.0 = Debug|Win32
{4F28B56B-F4B0-41B0-A785-597F6EF0163A}.Debug_wtl|x64.ActiveCfg = Debug|x64
{4F28B56B-F4B0-41B0-A785-597F6EF0163A}.Debug_wtl|x64.Build.0 = Debug|x64
{4F28B56B-F4B0-41B0-A785-597F6EF0163A}.Release_mupenplus|Win32.ActiveCfg = Release|Win32
{4F28B56B-F4B0-41B0-A785-597F6EF0163A}.Release_mupenplus|x64.ActiveCfg = Release|x64
{4F28B56B-F4B0-41B0-A785-597F6EF0163A}.Release_qt|Win32.ActiveCfg = Release|Win32
{4F28B56B-F4B0-41B0-A785-597F6EF0163A}.Release_qt|x64.ActiveCfg = Release|x64
{4F28B56B-F4B0-41B0-A785-597F6EF0163A}.Release_wtl|Win32.ActiveCfg = Release|Win32
{4F28B56B-F4B0-41B0-A785-597F6EF0163A}.Release_wtl|Win32.Build.0 = Release|Win32
{4F28B56B-F4B0-41B0-A785-597F6EF0163A}.Release_wtl|x64.ActiveCfg = Release|x64
{4F28B56B-F4B0-41B0-A785-597F6EF0163A}.Release_wtl|x64.Build.0 = Release|x64
{5480BC17-9C40-4E41-8AD4-AE12316D4CA4}.Debug_mupenplus|Win32.ActiveCfg = Debug|Win32
{5480BC17-9C40-4E41-8AD4-AE12316D4CA4}.Debug_mupenplus|x64.ActiveCfg = Debug|x64
{5480BC17-9C40-4E41-8AD4-AE12316D4CA4}.Debug_qt|Win32.ActiveCfg = Debug|Win32
{5480BC17-9C40-4E41-8AD4-AE12316D4CA4}.Debug_qt|x64.ActiveCfg = Debug|x64
{5480BC17-9C40-4E41-8AD4-AE12316D4CA4}.Debug_wtl|Win32.ActiveCfg = Debug|Win32
{5480BC17-9C40-4E41-8AD4-AE12316D4CA4}.Debug_wtl|Win32.Build.0 = Debug|Win32
{5480BC17-9C40-4E41-8AD4-AE12316D4CA4}.Debug_wtl|x64.ActiveCfg = Debug|x64
{5480BC17-9C40-4E41-8AD4-AE12316D4CA4}.Debug_wtl|x64.Build.0 = Debug|x64
{5480BC17-9C40-4E41-8AD4-AE12316D4CA4}.Release_mupenplus|Win32.ActiveCfg = Release|Win32
{5480BC17-9C40-4E41-8AD4-AE12316D4CA4}.Release_mupenplus|x64.ActiveCfg = Release|x64
{5480BC17-9C40-4E41-8AD4-AE12316D4CA4}.Release_qt|Win32.ActiveCfg = Release|Win32
{5480BC17-9C40-4E41-8AD4-AE12316D4CA4}.Release_qt|x64.ActiveCfg = Release|x64
{5480BC17-9C40-4E41-8AD4-AE12316D4CA4}.Release_wtl|Win32.ActiveCfg = Release|Win32
{5480BC17-9C40-4E41-8AD4-AE12316D4CA4}.Release_wtl|Win32.Build.0 = Release|Win32
{5480BC17-9C40-4E41-8AD4-AE12316D4CA4}.Release_wtl|x64.ActiveCfg = Release|x64
{5480BC17-9C40-4E41-8AD4-AE12316D4CA4}.Release_wtl|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
Qt5Version = $(DefaultQtVersion)
SolutionGuid = {D7155823-2893-4425-94B4-BA469E774A27}
Qt5Version = $(DefaultQtVersion)
EndGlobalSection
EndGlobal

View File

@ -9,22 +9,6 @@
<Configuration>Debug_mupenplus</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug_qt|Win32">
<Configuration>Debug_qt</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug_qt|x64">
<Configuration>Debug_qt</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug_wtl|Win32">
<Configuration>Debug_wtl</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug_wtl|x64">
<Configuration>Debug_wtl</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release_mupenplus|Win32">
<Configuration>Release_mupenplus</Configuration>
<Platform>Win32</Platform>
@ -33,22 +17,6 @@
<Configuration>Release_mupenplus</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release_qt|Win32">
<Configuration>Release_qt</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release_qt|x64">
<Configuration>Release_qt</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release_wtl|Win32">
<Configuration>Release_wtl</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release_wtl|x64">
<Configuration>Release_wtl</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{37D31D7F-C4E7-45B0-AEF6-D6824A243CF7}</ProjectGuid>
@ -81,15 +49,14 @@
<OutDir>$(SolutionDir)..\..\..\external\$(Platform)\</OutDir>
<IntDir>$(SolutionDir)build\$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Debug_qt' Or '$(Configuration)'=='Debug_wtl' Or'$(Configuration)'=='Debug_mupenplus'">
<PropertyGroup Condition="'$(Configuration)'=='Debug_mupenplus'">
<TargetName>GLideN64d</TargetName>
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Release_qt' Or '$(Configuration)'=='Release_wtl' Or '$(Configuration)'=='Release_mupenplus'">
<PropertyGroup Condition="'$(Configuration)'=='Release_mupenplus'">
<TargetName>GLideN64</TargetName>
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Debug_mupenplus' Or '$(Configuration)'=='Release_mupenplus'">
<TargetName>mupen64plus-video-GLideN64</TargetName>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>../../src;../../src/inc;../../src/osal;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
@ -111,20 +78,7 @@
<Command>call ..\..\src\getRevision.bat</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug_qt' Or '$(Configuration)'=='Debug_wtl' Or '$(Configuration)'=='Debug_mupenplus'">
<ClCompile>
<PreprocessorDefinitions>GL_DEBUG;DEBUG_DUMP;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Optimization>Disabled</Optimization>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>freetype253MT_D.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='Release_qt' Or '$(Configuration)'=='Release_wtl' Or '$(Configuration)'=='Release_mupenplus'">
<ItemDefinitionGroup Condition="'$(Configuration)'=='Release_mupenplus'">
<ClCompile>
<Optimization>Full</Optimization>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
@ -217,7 +171,7 @@ copy /Y "$(OutDir)$(TargetName).*" "$(PJ64PluginsDirWTL_x64)")</Command>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug_mupenplus' Or '$(Configuration)'=='Release_mupenplus'">
<ClCompile>
<PreprocessorDefinitions>MUPENPLUSAPI;NATIVE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NATIVE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<PostBuildEvent>
<Message>Copy result to plugins folder</Message>
@ -227,54 +181,18 @@ copy /Y "$(OutDir)$(TargetName).*" "$(Mupen64PluginsDir)")</Command>
copy /Y "$(OutDir)$(TargetName).*" "$(Mupen64PluginsDir_x64)")</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug_qt'">
<Link>
<AdditionalDependencies>bin\$(Platform)\Debug\lib\GLideNUI.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug_wtl'">
<Link>
<AdditionalDependencies>bin\$(Platform)\Debug\lib\GLideNUI-wtl.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='Release_qt'">
<Link>
<AdditionalDependencies>bin\$(Platform)\Release\lib\GLideNUI.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalOptions>/LTCG %(AdditionalOptions)</AdditionalOptions>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='Release_wtl'">
<Link>
<AdditionalDependencies>bin\$(Platform)\Release\lib\GLideNUI-wtl.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug_qt' Or '$(Configuration)'=='Debug_wtl' Or '$(Configuration)'=='Debug_mupenplus' Or '$(Configuration)'=='Release_qt' Or '$(Configuration)'=='Release_wtl' Or '$(Configuration)'=='Release_mupenplus'">
<ClCompile>
<AdditionalIncludeDirectories>../../src/inc/freetype/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ConformanceMode Condition="'$(Configuration)|$(Platform)'=='Debug_mupenplus|Win32'">true</ConformanceMode>
<LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Debug_mupenplus|Win32'">stdcpp17</LanguageStandard>
<ConformanceMode Condition="'$(Configuration)|$(Platform)'=='Debug_qt|Win32'">true</ConformanceMode>
<LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Debug_qt|Win32'">stdcpp17</LanguageStandard>
<ConformanceMode Condition="'$(Configuration)|$(Platform)'=='Debug_wtl|Win32'">true</ConformanceMode>
<LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Debug_wtl|Win32'">stdcpp17</LanguageStandard>
<ConformanceMode Condition="'$(Configuration)|$(Platform)'=='Release_mupenplus|Win32'">true</ConformanceMode>
<LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Release_mupenplus|Win32'">stdcpp17</LanguageStandard>
<ConformanceMode Condition="'$(Configuration)|$(Platform)'=='Release_qt|Win32'">true</ConformanceMode>
<LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Release_qt|Win32'">stdcpp17</LanguageStandard>
<ConformanceMode Condition="'$(Configuration)|$(Platform)'=='Release_wtl|Win32'">true</ConformanceMode>
<LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Release_wtl|Win32'">stdcpp17</LanguageStandard>
<ConformanceMode Condition="'$(Configuration)|$(Platform)'=='Debug_mupenplus|x64'">true</ConformanceMode>
<LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Debug_mupenplus|x64'">stdcpp17</LanguageStandard>
<ConformanceMode Condition="'$(Configuration)|$(Platform)'=='Debug_qt|x64'">true</ConformanceMode>
<LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Debug_qt|x64'">stdcpp17</LanguageStandard>
<ConformanceMode Condition="'$(Configuration)|$(Platform)'=='Debug_wtl|x64'">true</ConformanceMode>
<LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Debug_wtl|x64'">stdcpp17</LanguageStandard>
<ConformanceMode Condition="'$(Configuration)|$(Platform)'=='Release_mupenplus|x64'">true</ConformanceMode>
<LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Release_mupenplus|x64'">stdcpp17</LanguageStandard>
<ConformanceMode Condition="'$(Configuration)|$(Platform)'=='Release_qt|x64'">true</ConformanceMode>
<LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Release_qt|x64'">stdcpp17</LanguageStandard>
<ConformanceMode Condition="'$(Configuration)|$(Platform)'=='Release_wtl|x64'">true</ConformanceMode>
<LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Release_wtl|x64'">stdcpp17</LanguageStandard>
<RuntimeLibrary Condition="'$(Configuration)|$(Platform)'=='Debug_mupenplus|Win32'">MultiThreadedDebug</RuntimeLibrary>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
@ -321,9 +239,6 @@ copy /Y "$(OutDir)$(TargetName).*" "$(Mupen64PluginsDir_x64)")</Command>
<ClCompile Include="..\..\src\Graphics\OpenGLContext\GLSL\glsl_ShaderStorage.cpp" />
<ClCompile Include="..\..\src\Graphics\OpenGLContext\GLSL\glsl_SpecialShadersFactory.cpp" />
<ClCompile Include="..\..\src\Graphics\OpenGLContext\GLSL\glsl_Utils.cpp" />
<ClCompile Include="..\..\src\Graphics\OpenGLContext\mupen64plus\mupen64plus_DisplayWindow.cpp">
<ExcludedFromBuild Condition="'$(Configuration)'=='Debug_qt' Or '$(Configuration)'=='Debug_wtl' Or '$(Configuration)'=='Release_qt' Or '$(Configuration)'=='Release_wtl'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\Graphics\OpenGLContext\opengl_Attributes.cpp" />
<ClCompile Include="..\..\src\Graphics\OpenGLContext\opengl_BufferManipulationObjectFactory.cpp" />
<ClCompile Include="..\..\src\Graphics\OpenGLContext\opengl_CachedFunctions.cpp" />
@ -344,33 +259,26 @@ copy /Y "$(OutDir)$(TargetName).*" "$(Mupen64PluginsDir_x64)")</Command>
<ClCompile Include="..\..\src\Graphics\OpenGLContext\ThreadedOpenGl\RingBufferPool.cpp" />
<ClCompile Include="..\..\src\Graphics\OpenGLContext\windows\windows_DisplayWindow.cpp">
<ExcludedFromBuild Condition="'$(Configuration)'=='Debug_mupenplus' Or '$(Configuration)'=='Release_mupenplus'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_mupenplus|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_mupenplus|Win32'">false</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\Graphics\OpenGLContext\windows\WindowsWGL.cpp">
<ExcludedFromBuild Condition="'$(Configuration)'=='Debug_mupenplus' Or '$(Configuration)'=='Release_mupenplus'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_mupenplus|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_mupenplus|Win32'">false</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\gSP.cpp" />
<ClCompile Include="..\..\src\iob.cpp">
<ExcludedFromBuild Condition="'$(Platform)'=='Win32'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\Log.cpp" />
<ClCompile Include="..\..\src\MupenPlusPluginAPI.cpp">
<ExcludedFromBuild Condition="'$(Configuration)'=='Debug_qt' Or '$(Configuration)'=='Debug_wtl' Or '$(Configuration)'=='Release_qt' Or '$(Configuration)'=='Release_wtl'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_mupenplus|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\mupenplus\CommonAPIImpl_mupenplus.cpp">
<ExcludedFromBuild Condition="'$(Configuration)'=='Debug_qt' Or '$(Configuration)'=='Debug_wtl' Or '$(Configuration)'=='Release_qt' Or '$(Configuration)'=='Release_wtl'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\mupenplus\Config_mupenplus.cpp">
<ExcludedFromBuild Condition="'$(Configuration)'=='Debug_qt' Or '$(Configuration)'=='Debug_wtl' Or '$(Configuration)'=='Release_qt' Or '$(Configuration)'=='Release_wtl'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\mupenplus\MemoryStatus_mupenplus.cpp">
<ExcludedFromBuild Condition="'$(Configuration)'=='Debug_qt' Or '$(Configuration)'=='Debug_wtl' Or '$(Configuration)'=='Release_qt' Or '$(Configuration)'=='Release_wtl'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\mupenplus\MupenPlusAPIImpl.cpp">
<ExcludedFromBuild Condition="'$(Configuration)'=='Debug_qt' Or '$(Configuration)'=='Debug_wtl' Or '$(Configuration)'=='Release_qt' Or '$(Configuration)'=='Release_wtl'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\N64.cpp" />
<ClCompile Include="..\..\src\Native.cpp" />
<ClCompile Include="..\..\src\native\FileClass.cpp" />
<ClCompile Include="..\..\src\native\GlSettings.cpp" />
<ClCompile Include="..\..\src\native\IniFileClass.cpp" />
<ClCompile Include="..\..\src\native\Native.cpp" />
<ClCompile Include="..\..\src\native\NativeSettings.cpp" />
<ClCompile Include="..\..\src\native\util\util.cpp" />
<ClCompile Include="..\..\src\NoiseTexture.cpp" />
<ClCompile Include="..\..\src\PaletteTexture.cpp" />
<ClCompile Include="..\..\src\Performance.cpp" />
@ -381,12 +289,7 @@ copy /Y "$(OutDir)$(TargetName).*" "$(Mupen64PluginsDir_x64)")</Command>
<ClCompile Include="..\..\src\RSP_LoadMatrix.cpp">
<ExcludedFromBuild Condition="'$(Platform)'=='Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_mupenplus|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_wtl|Win32'">false</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\RSP_LoadMatrixX86.cpp">
<ExcludedFromBuild Condition="'$(Platform)'=='x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_mupenplus|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_wtl|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_mupenplus|Win32'">false</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\SoftwareRender.cpp" />
<ClCompile Include="..\..\src\TexrectDrawer.cpp" />
@ -419,28 +322,10 @@ copy /Y "$(OutDir)$(TargetName).*" "$(Mupen64PluginsDir_x64)")</Command>
<ClCompile Include="..\..\src\uCodes\ZSort.cpp" />
<ClCompile Include="..\..\src\uCodes\ZSortBOSS.cpp" />
<ClCompile Include="..\..\src\VI.cpp" />
<ClCompile Include="..\..\src\windows\CommonAPIImpl_windows.cpp">
<ExcludedFromBuild Condition="'$(Configuration)'=='Debug_mupenplus' Or '$(Configuration)'=='Release_mupenplus'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\GLideNUI\Config_GLideNUI.cpp">
<ExcludedFromBuild Condition="'$(Configuration)'=='Debug_mupenplus' Or '$(Configuration)'=='Release_mupenplus'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\windows\GLideN64_windows.cpp">
<ExcludedFromBuild Condition="'$(Configuration)'=='Debug_mupenplus' Or '$(Configuration)'=='Release_mupenplus'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\windows\MemoryStatus_windows.cpp">
<ExcludedFromBuild Condition="'$(Configuration)'=='Debug_mupenplus' Or '$(Configuration)'=='Release_mupenplus'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\windows\ZilmarAPIImpl_windows.cpp">
<ExcludedFromBuild Condition="'$(Configuration)'=='Debug_mupenplus' Or '$(Configuration)'=='Release_mupenplus'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\windows\ScreenShot.cpp">
<ExcludedFromBuild Condition="'$(Configuration)'=='Debug_mupenplus' Or '$(Configuration)'=='Release_mupenplus'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ZilmarPluginAPI.cpp">
<ExcludedFromBuild Condition="'$(Configuration)'=='Debug_mupenplus' Or '$(Configuration)'=='Release_mupenplus'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_wtl|Win32'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\windows\CommonAPIImpl_windows.cpp" />
<ClCompile Include="..\..\src\windows\GLideN64_windows.cpp" />
<ClCompile Include="..\..\src\windows\MemoryStatus_windows.cpp" />
<ClCompile Include="..\..\src\windows\ScreenShot.cpp" />
<ClCompile Include="..\..\src\ZlutTexture.cpp" />
</ItemGroup>
<ItemGroup>

View File

@ -66,9 +66,6 @@
<Filter Include="Source Files\Graphics\OpenGL\windows">
<UniqueIdentifier>{e8b5c80f-51ec-45c2-bcdb-5e18868073df}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\Graphics\OpenGL\mupen64plus">
<UniqueIdentifier>{77259791-9942-4601-a63f-5a0468e69e49}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files\Graphics\OpenGL\ThreadedOpenGL">
<UniqueIdentifier>{09919f83-2933-4b48-a4c7-f7bf6e790304}</UniqueIdentifier>
</Filter>
@ -78,6 +75,12 @@
<Filter Include="Resource Files">
<UniqueIdentifier>{afe20b4b-eb13-4282-bf72-47335887c770}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\native">
<UniqueIdentifier>{1b0ca6a9-2d38-4c4f-948a-adb40a8021c6}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\native\util">
<UniqueIdentifier>{3fbbb3f7-f454-4682-8933-5ca84cb40d6f}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\src\Combiner.cpp">
@ -119,42 +122,12 @@
<ClCompile Include="..\..\src\3DMath.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\MupenPlusPluginAPI.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\CommonPluginAPI.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ZilmarPluginAPI.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\common\CommonAPIImpl_common.cpp">
<Filter>Source Files\common</Filter>
</ClCompile>
<ClCompile Include="..\..\src\mupenplus\CommonAPIImpl_mupenplus.cpp">
<Filter>Source Files\mupenplus</Filter>
</ClCompile>
<ClCompile Include="..\..\src\mupenplus\MupenPlusAPIImpl.cpp">
<Filter>Source Files\mupenplus</Filter>
</ClCompile>
<ClCompile Include="..\..\src\windows\CommonAPIImpl_windows.cpp">
<Filter>Source Files\windows</Filter>
</ClCompile>
<ClCompile Include="..\..\src\windows\GLideN64_windows.cpp">
<Filter>Source Files\windows</Filter>
</ClCompile>
<ClCompile Include="..\..\src\windows\ZilmarAPIImpl_windows.cpp">
<Filter>Source Files\windows</Filter>
</ClCompile>
<ClCompile Include="..\..\src\windows\ScreenShot.cpp">
<Filter>Source Files\windows</Filter>
</ClCompile>
<ClCompile Include="..\..\src\GLideNUI\Config_GLidenUI.cpp">
<Filter>Source Files\windows</Filter>
</ClCompile>
<ClCompile Include="..\..\src\mupenplus\Config_mupenplus.cpp">
<Filter>Source Files\mupenplus</Filter>
</ClCompile>
<ClCompile Include="..\..\src\PostProcessor.cpp">
<Filter>Source Files</Filter>
</ClCompile>
@ -278,9 +251,6 @@
<ClCompile Include="..\..\src\Graphics\OpenGLContext\windows\WindowsWGL.cpp">
<Filter>Source Files\Graphics\OpenGL\windows</Filter>
</ClCompile>
<ClCompile Include="..\..\src\Graphics\OpenGLContext\mupen64plus\mupen64plus_DisplayWindow.cpp">
<Filter>Source Files\Graphics\OpenGL\mupen64plus</Filter>
</ClCompile>
<ClCompile Include="..\..\src\Graphics\OpenGLContext\opengl_UnbufferedDrawer.cpp">
<Filter>Source Files\Graphics\OpenGL</Filter>
</ClCompile>
@ -308,9 +278,6 @@
<ClCompile Include="..\..\src\Graphics\ObjectHandle.cpp">
<Filter>Source Files\Graphics</Filter>
</ClCompile>
<ClCompile Include="..\..\src\RSP_LoadMatrixX86.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\CRC_OPT.cpp">
<Filter>Source Files</Filter>
</ClCompile>
@ -407,12 +374,6 @@
<ClCompile Include="..\..\src\Graphics\OpenGLContext\GLSL\glsl_FXAA.cpp">
<Filter>Source Files\Graphics\OpenGL\GLSL</Filter>
</ClCompile>
<ClCompile Include="..\..\src\windows\MemoryStatus_windows.cpp">
<Filter>Source Files\windows</Filter>
</ClCompile>
<ClCompile Include="..\..\src\mupenplus\MemoryStatus_mupenplus.cpp">
<Filter>Source Files\mupenplus</Filter>
</ClCompile>
<ClCompile Include="..\..\src\Graphics\OpenGLContext\ThreadedOpenGl\opengl_Wrapper.cpp">
<Filter>Source Files\Graphics\OpenGL\ThreadedOpenGL</Filter>
</ClCompile>
@ -443,8 +404,35 @@
<ClCompile Include="..\..\src\Graphics\OpenGLContext\GLSL\glsl_CombinerProgramUniformFactoryFast.cpp">
<Filter>Source Files\Graphics\OpenGL\GLSL</Filter>
</ClCompile>
<ClCompile Include="..\..\src\Native.cpp">
<Filter>Source Files</Filter>
<ClCompile Include="..\..\src\windows\ScreenShot.cpp">
<Filter>Source Files\windows</Filter>
</ClCompile>
<ClCompile Include="..\..\src\windows\MemoryStatus_windows.cpp">
<Filter>Source Files\windows</Filter>
</ClCompile>
<ClCompile Include="..\..\src\windows\GLideN64_windows.cpp">
<Filter>Source Files\windows</Filter>
</ClCompile>
<ClCompile Include="..\..\src\windows\CommonAPIImpl_windows.cpp">
<Filter>Source Files\windows</Filter>
</ClCompile>
<ClCompile Include="..\..\src\native\Native.cpp">
<Filter>Source Files\native</Filter>
</ClCompile>
<ClCompile Include="..\..\src\native\NativeSettings.cpp">
<Filter>Source Files\native</Filter>
</ClCompile>
<ClCompile Include="..\..\src\native\IniFileClass.cpp">
<Filter>Source Files\native</Filter>
</ClCompile>
<ClCompile Include="..\..\src\native\util\util.cpp">
<Filter>Source Files\native\util</Filter>
</ClCompile>
<ClCompile Include="..\..\src\native\GlSettings.cpp">
<Filter>Source Files\native</Filter>
</ClCompile>
<ClCompile Include="..\..\src\native\FileClass.cpp">
<Filter>Source Files\native</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>

View File

@ -1,196 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{9E05B70F-A294-44A9-A151-B2CC95AA884E}</ProjectGuid>
<RootNamespace>GLideNUIwtl</RootNamespace>
</PropertyGroup>
<PropertyGroup Condition="'$(WindowsTargetPlatformVersion)'=='' and '$(VisualStudioVersion)' != '12.0' and '$(VisualStudioVersion)' != '14.0'">
<LatestTargetPlatformVersion>$([Microsoft.Build.Utilities.ToolLocationHelper]::GetLatestSDKTargetPlatformVersion('Windows', '10.0'))</LatestTargetPlatformVersion>
<WindowsTargetPlatformVersion>$(LatestTargetPlatformVersion)</WindowsTargetPlatformVersion>
<TargetPlatformVersion>$(WindowsTargetPlatformVersion)</TargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<PlatformToolSet>$(DefaultPlatformToolset)</PlatformToolSet>
<ATLMinimizesCRunTimeLibraryUsage>false</ATLMinimizesCRunTimeLibraryUsage>
<CharacterSet>NotSet</CharacterSet>
<ConfigurationType>StaticLibrary</ConfigurationType>
<PrimaryOutput>GLideNUI-wtl</PrimaryOutput>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings" />
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<OutDir>$(SolutionDir)..\..\..\external\$(Platform)\</OutDir>
<IntDir>$(SolutionDir)build\$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
<TargetName>$(ProjectName)</TargetName>
<IgnoreImportLibrary>true</IgnoreImportLibrary>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<PreprocessorDefinitions>_WINDOWS;UNICODE;WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>-Zm200 -w34100 -w34189 %(AdditionalOptions)</AdditionalOptions>
<AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
<BrowseInformation>false</BrowseInformation>
<ExceptionHandling>Sync</ExceptionHandling>
<ObjectFileName>$(IntDir)</ObjectFileName>
<PreprocessToFile>false</PreprocessToFile>
<ProgramDataBaseFileName>$(IntDir)vc$(VisualStudioVersion).pdb</ProgramDataBaseFileName>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
<WarningLevel>Level3</WarningLevel>
<OutputFile>$(OutDir)\GLideNUI-wtl.lib</OutputFile>
</ClCompile>
<Lib>
<AdditionalDependencies>imm32.lib;Ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'">
<ClCompile>
<PreprocessorDefinitions>DEBUG_DUMP;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<Optimization>Disabled</Optimization>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">stdcpp17</LanguageStandard>
<LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">stdcpp17</LanguageStandard>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='Release'">
<ClCompile>
<DebugInformationFormat>None</DebugInformationFormat>
<Optimization>MaxSpeed</Optimization>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<WholeProgramOptimization>false</WholeProgramOptimization>
<LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">stdcpp17</LanguageStandard>
<LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Release|x64'">stdcpp17</LanguageStandard>
</ClCompile>
<Lib>
<LinkTimeCodeGeneration>true</LinkTimeCodeGeneration>
</Lib>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\src\GLideNUI-wtl\About.cpp" />
<ClCompile Include="..\..\src\GLideNUI-wtl\config-debug.cpp" />
<ClCompile Include="..\..\src\GLideNUI-wtl\config-emulation.cpp" />
<ClCompile Include="..\..\src\GLideNUI-wtl\config-framebuffer.cpp" />
<ClCompile Include="..\..\src\GLideNUI-wtl\config-osd.cpp" />
<ClCompile Include="..\..\src\GLideNUI-wtl\config-overscan.cpp" />
<ClCompile Include="..\..\src\GLideNUI-wtl\config-tab.cpp" />
<ClCompile Include="..\..\src\GLideNUI-wtl\config-texture.cpp" />
<ClCompile Include="..\..\src\GLideNUI-wtl\config-video.cpp" />
<ClCompile Include="..\..\src\GLideNUI-wtl\ConfigDlg.cpp" />
<ClCompile Include="..\..\src\GLideNUI-wtl\FileClass.cpp" />
<ClCompile Include="..\..\src\GLideNUI-wtl\FontInfo.cpp" />
<ClCompile Include="..\..\src\GLideNUI-wtl\fullscreenresolutions_windows.cpp" />
<ClCompile Include="..\..\src\GLideNUI-wtl\GLideNUI.cpp" />
<ClCompile Include="..\..\src\GLideNUI-wtl\GlSettings.cpp" />
<ClCompile Include="..\..\src\GLideNUI-wtl\IniFileClass.cpp" />
<ClCompile Include="..\..\src\GLideNUI-wtl\InputDialog.cpp" />
<ClCompile Include="..\..\src\GLideNUI-wtl\Language.cpp" />
<ClCompile Include="..\..\src\GLideNUI-wtl\Settings.cpp" />
<ClCompile Include="..\..\src\GLideNUI-wtl\util\StdString.cpp" />
<ClCompile Include="..\..\src\GLideNUI-wtl\util\util.cpp" />
<ClCompile Include="..\..\src\GLideNUI-wtl\wtl-BitmapPicture.cpp" />
<ClCompile Include="..\..\src\GLideNUI-wtl\wtl-ColorButton.cpp" />
<ClCompile Include="..\..\src\GLideNUI-wtl\wtl-OsdButton.cpp" />
<ClCompile Include="..\..\src\GLideNUI-wtl\wtl-OsdPreview.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\src\GLideNUI-wtl\About.h" />
<ClInclude Include="..\..\src\GLideNUI-wtl\config-debug.h" />
<ClInclude Include="..\..\src\GLideNUI-wtl\config-emulation.h" />
<ClInclude Include="..\..\src\GLideNUI-wtl\config-framebuffer.h" />
<ClInclude Include="..\..\src\GLideNUI-wtl\config-osd.h" />
<ClInclude Include="..\..\src\GLideNUI-wtl\config-overscan.h" />
<ClInclude Include="..\..\src\GLideNUI-wtl\config-tab.h" />
<ClInclude Include="..\..\src\GLideNUI-wtl\config-texture.h" />
<ClInclude Include="..\..\src\GLideNUI-wtl\config-video.h" />
<ClInclude Include="..\..\src\GLideNUI-wtl\ConfigDlg.h" />
<ClInclude Include="..\..\src\GLideNUI-wtl\FileClass.h" />
<ClInclude Include="..\..\src\GLideNUI-wtl\FontInfo.h" />
<ClInclude Include="..\..\src\GLideNUI-wtl\FullscreenResolutions.h" />
<ClInclude Include="..\..\src\GLideNUI-wtl\GLideNUI.h" />
<ClInclude Include="..\..\src\GLideNUI-wtl\GlSettings.h" />
<ClInclude Include="..\..\src\GLideNUI-wtl\IniFileClass.h" />
<ClInclude Include="..\..\src\GLideNUI-wtl\InputDialog.h" />
<ClInclude Include="..\..\src\GLideNUI-wtl\Language.h" />
<ClInclude Include="..\..\src\GLideNUI-wtl\resource.h" />
<ClInclude Include="..\..\src\GLideNUI-wtl\Settings.h" />
<ClInclude Include="..\..\src\GLideNUI-wtl\util\StdString.h" />
<ClInclude Include="..\..\src\GLideNUI-wtl\util\util.h" />
<ClInclude Include="..\..\src\GLideNUI-wtl\wtl-BitmapPicture.h" />
<ClInclude Include="..\..\src\GLideNUI-wtl\wtl-ColorButton.h" />
<ClInclude Include="..\..\src\GLideNUI-wtl\wtl-OsdButton.h" />
<ClInclude Include="..\..\src\GLideNUI-wtl\wtl-OsdPreview.h" />
<ClInclude Include="..\..\src\GLideNUI-wtl\wtl-tooltip.h" />
<ClInclude Include="..\..\src\GLideNUI-wtl\wtl-WindowFont.h" />
<ClInclude Include="..\..\src\GLideNUI-wtl\wtl.h" />
<ClInclude Include="..\..\src\GLideNUI-wtl\WTL\atlapp.h" />
<ClInclude Include="..\..\src\GLideNUI-wtl\WTL\atlcrack.h" />
<ClInclude Include="..\..\src\GLideNUI-wtl\WTL\atlctrls.h" />
<ClInclude Include="..\..\src\GLideNUI-wtl\WTL\atlctrlw.h" />
<ClInclude Include="..\..\src\GLideNUI-wtl\WTL\atlctrlx.h" />
<ClInclude Include="..\..\src\GLideNUI-wtl\WTL\atlddx.h" />
<ClInclude Include="..\..\src\GLideNUI-wtl\WTL\atldlgs.h" />
<ClInclude Include="..\..\src\GLideNUI-wtl\WTL\atldwm.h" />
<ClInclude Include="..\..\src\GLideNUI-wtl\WTL\atlfind.h" />
<ClInclude Include="..\..\src\GLideNUI-wtl\WTL\atlframe.h" />
<ClInclude Include="..\..\src\GLideNUI-wtl\WTL\atlgdi.h" />
<ClInclude Include="..\..\src\GLideNUI-wtl\WTL\atlmisc.h" />
<ClInclude Include="..\..\src\GLideNUI-wtl\WTL\atlprint.h" />
<ClInclude Include="..\..\src\GLideNUI-wtl\WTL\atlres.h" />
<ClInclude Include="..\..\src\GLideNUI-wtl\WTL\atlresce.h" />
<ClInclude Include="..\..\src\GLideNUI-wtl\WTL\atlribbon.h" />
<ClInclude Include="..\..\src\GLideNUI-wtl\WTL\atlscrl.h" />
<ClInclude Include="..\..\src\GLideNUI-wtl\WTL\atlsplit.h" />
<ClInclude Include="..\..\src\GLideNUI-wtl\WTL\atltheme.h" />
<ClInclude Include="..\..\src\GLideNUI-wtl\WTL\atluser.h" />
<ClInclude Include="..\..\src\GLideNUI-wtl\WTL\atlwince.h" />
<ClInclude Include="..\..\src\GLideNUI-wtl\WTL\atlwinx.h" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\..\src\GLideNUI-wtl\GLideNUI.rc" />
</ItemGroup>
<ItemGroup>
<Image Include="..\..\src\GLideNUI\Resources\BottomLeft.ico" />
<Image Include="..\..\src\GLideNUI\Resources\BottomRight.ico" />
<Image Include="..\..\src\GLideNUI\Resources\Down.ico" />
<Image Include="..\..\src\GLideNUI\Resources\Icon-Original.ico" />
<Image Include="..\..\src\GLideNUI\Resources\Icon.ico" />
<Image Include="..\..\src\GLideNUI\Resources\Info.ico" />
<Image Include="..\..\src\GLideNUI\Resources\Left.ico" />
<Image Include="..\..\src\GLideNUI\Resources\Right.ico" />
<Image Include="..\..\src\GLideNUI\Resources\TopLeft.ico" />
<Image Include="..\..\src\GLideNUI\Resources\TopRight.ico" />
<Image Include="..\..\src\GLideNUI\Resources\Up.ico" />
<Image Include="..\..\src\GLideNUI\Resources\Warning.ico" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets" />
<ProjectExtensions>
</ProjectExtensions>
</Project>

View File

@ -1,295 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
<Filter Include="Header Files\WTL">
<UniqueIdentifier>{b0c2b4e8-31f7-46e5-9b96-cfe8b94db5cf}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\src\GLideNUI-wtl\About.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\GLideNUI-wtl\config-debug.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\GLideNUI-wtl\ConfigDlg.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\GLideNUI-wtl\config-emulation.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\GLideNUI-wtl\config-framebuffer.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\GLideNUI-wtl\config-osd.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\GLideNUI-wtl\config-overscan.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\GLideNUI-wtl\config-tab.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\GLideNUI-wtl\config-texture.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\GLideNUI-wtl\config-video.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\GLideNUI-wtl\FileClass.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\GLideNUI-wtl\FontInfo.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\GLideNUI-wtl\fullscreenresolutions_windows.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\GLideNUI-wtl\GLideNUI.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\GLideNUI-wtl\GlSettings.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\GLideNUI-wtl\IniFileClass.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\GLideNUI-wtl\Settings.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\GLideNUI-wtl\util\util.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\GLideNUI-wtl\wtl-BitmapPicture.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\GLideNUI-wtl\wtl-ColorButton.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\GLideNUI-wtl\wtl-OsdButton.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\GLideNUI-wtl\wtl-OsdPreview.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\GLideNUI-wtl\InputDialog.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\GLideNUI-wtl\Language.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\GLideNUI-wtl\util\StdString.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\src\GLideNUI-wtl\About.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\GLideNUI-wtl\config-debug.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\GLideNUI-wtl\ConfigDlg.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\GLideNUI-wtl\config-emulation.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\GLideNUI-wtl\config-framebuffer.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\GLideNUI-wtl\config-osd.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\GLideNUI-wtl\config-overscan.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\GLideNUI-wtl\config-tab.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\GLideNUI-wtl\config-texture.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\GLideNUI-wtl\config-video.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\GLideNUI-wtl\FileClass.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\GLideNUI-wtl\FontInfo.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\GLideNUI-wtl\FullscreenResolutions.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\GLideNUI-wtl\GLideNUI.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\GLideNUI-wtl\GlSettings.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\GLideNUI-wtl\IniFileClass.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\GLideNUI-wtl\resource.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\GLideNUI-wtl\Settings.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\GLideNUI-wtl\util\util.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\GLideNUI-wtl\wtl.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\GLideNUI-wtl\wtl-BitmapPicture.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\GLideNUI-wtl\wtl-ColorButton.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\GLideNUI-wtl\wtl-OsdButton.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\GLideNUI-wtl\wtl-OsdPreview.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\GLideNUI-wtl\wtl-WindowFont.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\GLideNUI-wtl\WTL\atlapp.h">
<Filter>Header Files\WTL</Filter>
</ClInclude>
<ClInclude Include="..\..\src\GLideNUI-wtl\WTL\atlcrack.h">
<Filter>Header Files\WTL</Filter>
</ClInclude>
<ClInclude Include="..\..\src\GLideNUI-wtl\WTL\atlctrls.h">
<Filter>Header Files\WTL</Filter>
</ClInclude>
<ClInclude Include="..\..\src\GLideNUI-wtl\WTL\atlctrlw.h">
<Filter>Header Files\WTL</Filter>
</ClInclude>
<ClInclude Include="..\..\src\GLideNUI-wtl\WTL\atlctrlx.h">
<Filter>Header Files\WTL</Filter>
</ClInclude>
<ClInclude Include="..\..\src\GLideNUI-wtl\WTL\atlddx.h">
<Filter>Header Files\WTL</Filter>
</ClInclude>
<ClInclude Include="..\..\src\GLideNUI-wtl\WTL\atldlgs.h">
<Filter>Header Files\WTL</Filter>
</ClInclude>
<ClInclude Include="..\..\src\GLideNUI-wtl\WTL\atldwm.h">
<Filter>Header Files\WTL</Filter>
</ClInclude>
<ClInclude Include="..\..\src\GLideNUI-wtl\WTL\atlfind.h">
<Filter>Header Files\WTL</Filter>
</ClInclude>
<ClInclude Include="..\..\src\GLideNUI-wtl\WTL\atlframe.h">
<Filter>Header Files\WTL</Filter>
</ClInclude>
<ClInclude Include="..\..\src\GLideNUI-wtl\WTL\atlgdi.h">
<Filter>Header Files\WTL</Filter>
</ClInclude>
<ClInclude Include="..\..\src\GLideNUI-wtl\WTL\atlmisc.h">
<Filter>Header Files\WTL</Filter>
</ClInclude>
<ClInclude Include="..\..\src\GLideNUI-wtl\WTL\atlprint.h">
<Filter>Header Files\WTL</Filter>
</ClInclude>
<ClInclude Include="..\..\src\GLideNUI-wtl\WTL\atlres.h">
<Filter>Header Files\WTL</Filter>
</ClInclude>
<ClInclude Include="..\..\src\GLideNUI-wtl\WTL\atlresce.h">
<Filter>Header Files\WTL</Filter>
</ClInclude>
<ClInclude Include="..\..\src\GLideNUI-wtl\WTL\atlribbon.h">
<Filter>Header Files\WTL</Filter>
</ClInclude>
<ClInclude Include="..\..\src\GLideNUI-wtl\WTL\atlscrl.h">
<Filter>Header Files\WTL</Filter>
</ClInclude>
<ClInclude Include="..\..\src\GLideNUI-wtl\WTL\atlsplit.h">
<Filter>Header Files\WTL</Filter>
</ClInclude>
<ClInclude Include="..\..\src\GLideNUI-wtl\WTL\atltheme.h">
<Filter>Header Files\WTL</Filter>
</ClInclude>
<ClInclude Include="..\..\src\GLideNUI-wtl\WTL\atluser.h">
<Filter>Header Files\WTL</Filter>
</ClInclude>
<ClInclude Include="..\..\src\GLideNUI-wtl\WTL\atlwince.h">
<Filter>Header Files\WTL</Filter>
</ClInclude>
<ClInclude Include="..\..\src\GLideNUI-wtl\WTL\atlwinx.h">
<Filter>Header Files\WTL</Filter>
</ClInclude>
<ClInclude Include="..\..\src\GLideNUI-wtl\InputDialog.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\GLideNUI-wtl\Language.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\GLideNUI-wtl\wtl-tooltip.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\GLideNUI-wtl\util\StdString.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Image Include="..\..\src\GLideNUI\Resources\BottomLeft.ico">
<Filter>Resource Files</Filter>
</Image>
<Image Include="..\..\src\GLideNUI\Resources\BottomRight.ico">
<Filter>Resource Files</Filter>
</Image>
<Image Include="..\..\src\GLideNUI\Resources\Down.ico">
<Filter>Resource Files</Filter>
</Image>
<Image Include="..\..\src\GLideNUI\Resources\Icon.ico">
<Filter>Resource Files</Filter>
</Image>
<Image Include="..\..\src\GLideNUI\Resources\Icon-Original.ico">
<Filter>Resource Files</Filter>
</Image>
<Image Include="..\..\src\GLideNUI\Resources\Info.ico">
<Filter>Resource Files</Filter>
</Image>
<Image Include="..\..\src\GLideNUI\Resources\Left.ico">
<Filter>Resource Files</Filter>
</Image>
<Image Include="..\..\src\GLideNUI\Resources\Right.ico">
<Filter>Resource Files</Filter>
</Image>
<Image Include="..\..\src\GLideNUI\Resources\TopLeft.ico">
<Filter>Resource Files</Filter>
</Image>
<Image Include="..\..\src\GLideNUI\Resources\TopRight.ico">
<Filter>Resource Files</Filter>
</Image>
<Image Include="..\..\src\GLideNUI\Resources\Up.ico">
<Filter>Resource Files</Filter>
</Image>
<Image Include="..\..\src\GLideNUI\Resources\Warning.ico">
<Filter>Resource Files</Filter>
</Image>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\..\src\GLideNUI-wtl\GLideNUI.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
</Project>

View File

@ -1,48 +0,0 @@
#-------------------------------------------------
#
# Project created by QtCreator 2015-01-26T21:59:49
#
#-------------------------------------------------
QT += core gui
QTPLUGIN += qico
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = GLideNUI
TEMPLATE = lib
CONFIG += staticlib
CONFIG += c++11
VPATH += ./../../src/GLideNUI/
SOURCES += \
ConfigDialog.cpp \
GLideNUI.cpp \
FullscreenResolutions_windows.cpp \
Settings.cpp \
ScreenShot.cpp \
AboutDialog.cpp
HEADERS += \
ConfigDialog.h \
GLideNUI.h \
FullscreenResolutions.h \
Settings.h \
AboutDialog.h
RESOURCES += \
icon.qrc
FORMS += \
configDialog.ui \
AboutDialog.ui
TRANSLATIONS = gliden64_fr.ts \
gliden64_de.ts \
gliden64_it.ts \
gliden64_es.ts \
gliden64_pl.ts \
gliden64_pt_BR.ts \
gliden64_ja.ts
DISTFILES +=

View File

@ -1,202 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{37CAB375-A7A6-3CAB-BD56-0E954D3FD2FE}</ProjectGuid>
<RootNamespace>GLideNUI</RootNamespace>
<Keyword>Qt4VSv1.0</Keyword>
</PropertyGroup>
<PropertyGroup Condition="'$(WindowsTargetPlatformVersion)'=='' and '$(VisualStudioVersion)' != '12.0' and '$(VisualStudioVersion)' != '14.0'">
<LatestTargetPlatformVersion>$([Microsoft.Build.Utilities.ToolLocationHelper]::GetLatestSDKTargetPlatformVersion('Windows', '10.0'))</LatestTargetPlatformVersion>
<WindowsTargetPlatformVersion>$(LatestTargetPlatformVersion)</WindowsTargetPlatformVersion>
<TargetPlatformVersion>$(WindowsTargetPlatformVersion)</TargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<PlatformToolSet>$(DefaultPlatformToolset)</PlatformToolSet>
<ATLMinimizesCRunTimeLibraryUsage>false</ATLMinimizesCRunTimeLibraryUsage>
<CharacterSet>NotSet</CharacterSet>
<ConfigurationType>StaticLibrary</ConfigurationType>
<PrimaryOutput>GLideNUI</PrimaryOutput>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings" />
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<OutDir>$(SolutionDir)bin\$(Platform)\$(Configuration)\lib\</OutDir>
<IntDir>$(SolutionDir)build\$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
<TargetName>$(ProjectName)</TargetName>
<IgnoreImportLibrary>true</IgnoreImportLibrary>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<PreprocessorDefinitions>_WINDOWS;UNICODE;WIN32;QT_STATICPLUGIN;QT_WIDGETS_LIB;QT_GUI_LIB;QT_CORE_LIB;QT_UITOOLS_LIB;QT_WINEXTRAS_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(QTDIR)\include;$(QTDIR)\include\QtWidgets;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtCore;release;.;$(QTDIR)\mkspecs\win32-msvc2013;.\GeneratedFiles;$(QTDIR)\include\QtUiTools;$(QTDIR)\include\QtWinExtras;$(ProjectDir)..\..\src\osal;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>-Zm200 -w34100 -w34189 %(AdditionalOptions)</AdditionalOptions>
<AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
<BrowseInformation>false</BrowseInformation>
<ExceptionHandling>Sync</ExceptionHandling>
<ObjectFileName>$(IntDir)</ObjectFileName>
<PreprocessorDefinitions>OS_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessToFile>false</PreprocessToFile>
<ProgramDataBaseFileName>$(IntDir)vc$(VisualStudioVersion).pdb</ProgramDataBaseFileName>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
<WarningLevel>Level3</WarningLevel>
<OutputFile>$(OutDir)\GLideNUI.lib</OutputFile>
</ClCompile>
<Lib>
<AdditionalLibraryDirectories>$(QTDIR)\lib;$(QTDIR)\plugins\styles;$(QTDIR)\plugins\platforms;$(QTDIR)\plugins\imageformats</AdditionalLibraryDirectories>
<AdditionalDependencies>imm32.lib;Ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'">
<ClCompile>
<PreprocessorDefinitions>DEBUG_DUMP;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<Optimization>Disabled</Optimization>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<ConformanceMode Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ConformanceMode>
<LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">stdcpp17</LanguageStandard>
<ConformanceMode Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ConformanceMode>
<LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">stdcpp17</LanguageStandard>
</ClCompile>
<Lib>
<AdditionalDependencies>qtpcre2d.lib;qtmaind.lib;qwindowsd.lib;qicod.lib;Qt5Cored.lib;Qt5Guid.lib;Qt5Widgetsd.lib;UxTheme.lib;qwindowsvistastyled.lib;Qt5WindowsUiAutomationSupportd.lib;Qt5FontDatabaseSupportd.lib;Qt5EventDispatcherSupportd.lib;Qt5FontDatabaseSupportd.lib;Qt5ThemeSupportd.lib;qtharfbuzzd.lib;Ws2_32.lib;Netapi32.lib;Userenv.lib;Ws2_32.lib;Wtsapi32.lib;Imm32.lib;WinMM.lib;Version.lib;Netapi32.lib;Dwmapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Lib>
<Link>
<AdditionalDependencies>Qt5UiToolsd.lib;Qt5WinExtrasd.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='Release'">
<ClCompile>
<PreprocessorDefinitions>QT_NO_DEBUG;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DebugInformationFormat>None</DebugInformationFormat>
<Optimization>MaxSpeed</Optimization>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<WholeProgramOptimization>false</WholeProgramOptimization>
<ConformanceMode Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ConformanceMode>
<LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">stdcpp17</LanguageStandard>
<ConformanceMode Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ConformanceMode>
<LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Release|x64'">stdcpp17</LanguageStandard>
</ClCompile>
<Lib>
<AdditionalDependencies>qtpcre2.lib;qtmain.lib;qwindows.lib;qico.lib;Qt5Core.lib;Qt5Gui.lib;Qt5Widgets.lib;UxTheme.lib;qwindowsvistastyle.lib;Qt5WindowsUiAutomationSupport.lib;Qt5FontDatabaseSupport.lib;Qt5EventDispatcherSupport.lib;Qt5FontDatabaseSupport.lib;Qt5ThemeSupport.lib;qtharfbuzz.lib;Ws2_32.lib;Netapi32.lib;Userenv.lib;Ws2_32.lib;Wtsapi32.lib;Imm32.lib;WinMM.lib;Version.lib;Netapi32.lib;Dwmapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Lib>
<Link>
<AdditionalDependencies>Qt5UiTools.lib;Qt5WinExtras.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<Lib>
<LinkTimeCodeGeneration>true</LinkTimeCodeGeneration>
</Lib>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\src\GLideNUI\AboutDialog.cpp" />
<ClCompile Include="..\..\src\GLideNUI\ConfigDialog.cpp" />
<ClCompile Include="..\..\src\GLideNUI\QtKeyToHID.cpp" />
<ClCompile Include="..\..\SRC\GLideNUI\HIDKeyToName.cpp" />
<ClCompile Include="Debug\moc_AboutDialog.cpp">
<ExcludedFromBuild Condition="'$(Configuration)'=='Release'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="Debug\moc_ConfigDialog.cpp">
<ExcludedFromBuild Condition="'$(Configuration)'=='Release'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\GLideNUI\FullscreenResolutions_windows.cpp" />
<ClCompile Include="GeneratedFiles\qrc_icon.cpp">
<PrecompiledHeader>
</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\..\src\GLideNUI\GLideNUI.cpp" />
<ClCompile Include="Release\moc_AboutDialog.cpp">
<ExcludedFromBuild Condition="'$(Configuration)'=='Debug'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="Release\moc_ConfigDialog.cpp">
<ExcludedFromBuild Condition="'$(Configuration)'=='Debug'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\GLideNUI\Settings.cpp" />
</ItemGroup>
<ItemGroup>
<CustomBuild Include="..\..\src\GLideNUI\AboutDialog.h">
<Command>setlocal
if errorlevel 1 goto VCEnd
if errorlevel 1 goto VCEnd
endlocal
"$(QTDIR)\bin\moc.exe" "%(FullPath)" -o "$(ConfigurationName)\moc_%(Filename).cpp" -D_WINDOWS -DUNICODE -DWIN32 -DQT_STATICPLUGIN -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DNDEBUG -DQT_UITOOLS_LIB -DQT_WINEXTRAS_LIB "-I$(QTDIR)\include" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtCore" "-I.\release" "-I." "-I$(QTDIR)\mkspecs\win32-msvc2013" "-I.\GeneratedFiles" "-I$(QTDIR)\include\QtUiTools" "-I$(QTDIR)\include\QtWinExtras"</Command>
<Message>Moc%27ing AboutDialog.h...</Message>
<Outputs>$(ConfigurationName)\moc_%(Filename).cpp</Outputs>
<AdditionalInputs>$(QTDIR)\bin\moc.exe;%(FullPath)</AdditionalInputs>
</CustomBuild>
<CustomBuild Include="..\..\src\GLideNUI\ConfigDialog.h">
<Command>setlocal
if errorlevel 1 goto VCEnd
if errorlevel 1 goto VCEnd
endlocal
"$(QTDIR)\bin\moc.exe" "%(FullPath)" -o "$(ConfigurationName)\moc_%(Filename).cpp" -D_WINDOWS -DUNICODE -DWIN32 -DQT_STATICPLUGIN -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DNDEBUG -DQT_UITOOLS_LIB -DQT_WINEXTRAS_LIB "-I$(QTDIR)\include" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtCore" "-I.\release" "-I." "-I$(QTDIR)\mkspecs\win32-msvc2013" "-I.\GeneratedFiles" "-I$(QTDIR)\include\QtUiTools" "-I$(QTDIR)\include\QtWinExtras"</Command>
<Message>Moc%27ing ConfigDialog.h...</Message>
<Outputs>$(ConfigurationName)\moc_%(Filename).cpp</Outputs>
<AdditionalInputs>$(QTDIR)\bin\moc.exe;%(FullPath)</AdditionalInputs>
</CustomBuild>
<ClInclude Include="..\..\src\GLideNUI\FullscreenResolutions.h" />
<ClInclude Include="GeneratedFiles\ui_AboutDialog.h" />
<ClInclude Include="GeneratedFiles\ui_configDialog.h" />
<ClInclude Include="..\..\src\GLideNUI\GLideNUI.h" />
<ClInclude Include="..\..\src\GLideNUI\Settings.h" />
</ItemGroup>
<ItemGroup>
<CustomBuild Include="..\..\src\GLideNUI\AboutDialog.ui">
<FileType>Document</FileType>
<AdditionalInputs>$(QTDIR)\bin\uic.exe;%(AdditionalInputs)</AdditionalInputs>
<Command>"$(QTDIR)\bin\uic.exe" -o ".\GeneratedFiles\ui_%(Filename).h" "%(FullPath)"</Command>
<Message>Uic%27ing %(Identity)...</Message>
<Outputs>.\GeneratedFiles\ui_%(Filename).h;%(Outputs)</Outputs>
</CustomBuild>
<CustomBuild Include="..\..\src\GLideNUI\configDialog.ui">
<FileType>Document</FileType>
<AdditionalInputs>$(QTDIR)\bin\uic.exe;%(AdditionalInputs)</AdditionalInputs>
<Command>"$(QTDIR)\bin\uic.exe" -o ".\GeneratedFiles\ui_%(Filename).h" "%(FullPath)"</Command>
<Message>Uic%27ing %(Identity)...</Message>
<Outputs>.\GeneratedFiles\ui_%(Filename).h;%(Outputs)</Outputs>
</CustomBuild>
</ItemGroup>
<ItemGroup>
<None Include="..\..\src\GLideNUI\Resources\Icon.ico">
<ExcludedFromBuild>true</ExcludedFromBuild>
</None>
<CustomBuild Include="..\..\src\GLideNUI\icon.qrc">
<FileType>Document</FileType>
<AdditionalInputs>%(FullPath);.\Icon.ico;%(AdditionalInputs)</AdditionalInputs>
<Command>"$(QTDIR)\bin\rcc.exe" -name "%(Filename)" -no-compress "%(FullPath)" -o .\GeneratedFiles\qrc_%(Filename).cpp</Command>
<Message>Rcc%27ing %(Identity)...</Message>
<Outputs>.\GeneratedFiles\qrc_%(Filename).cpp;%(Outputs)</Outputs>
</CustomBuild>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets" />
<ProjectExtensions>
<VisualStudio>
<UserProperties UicDir=".\GeneratedFiles" RccDir=".\GeneratedFiles" Qt5Version_x0020_Win32="$(DefaultQtVersion)" />
</VisualStudio>
</ProjectExtensions>
</Project>

View File

@ -1,138 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Form Files">
<UniqueIdentifier>{99349809-55BA-4b9d-BF79-8FDBB0286EB3}</UniqueIdentifier>
<Extensions>ui</Extensions>
<ParseFiles>false</ParseFiles>
</Filter>
<Filter Include="Form Files">
<UniqueIdentifier>{99349809-55BA-4b9d-BF79-8FDBB0286EB3}</UniqueIdentifier>
<Extensions>ui</Extensions>
<ParseFiles>false</ParseFiles>
</Filter>
<Filter Include="Generated Files">
<UniqueIdentifier>{71ED8ED8-ACB9-4CE9-BBE1-E00B30144E11}</UniqueIdentifier>
<Extensions>cpp;c;cxx;moc;h;def;odl;idl;res;</Extensions>
</Filter>
<Filter Include="Generated Files">
<UniqueIdentifier>{71ED8ED8-ACB9-4CE9-BBE1-E00B30144E11}</UniqueIdentifier>
<Extensions>cpp;c;cxx;moc;h;def;odl;idl;res;</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{D9D6E242-F8AF-46E4-B9FD-80ECBC20BA3E}</UniqueIdentifier>
<Extensions>qrc;*</Extensions>
<ParseFiles>false</ParseFiles>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{D9D6E242-F8AF-46E4-B9FD-80ECBC20BA3E}</UniqueIdentifier>
<Extensions>qrc;*</Extensions>
<ParseFiles>false</ParseFiles>
</Filter>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Generated Files\Debug">
<UniqueIdentifier>{81db5148-64bc-4cdf-b666-47488b3cb857}</UniqueIdentifier>
<Extensions>cpp;moc</Extensions>
<SourceControlFiles>False</SourceControlFiles>
</Filter>
<Filter Include="Generated Files\Release">
<UniqueIdentifier>{2d0855ca-d6fc-413c-8d8f-93865ecb277b}</UniqueIdentifier>
<Extensions>cpp;moc</Extensions>
<SourceControlFiles>False</SourceControlFiles>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\src\GLideNUI\AboutDialog.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\GLideNUI\ConfigDialog.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\GLideNUI\FullscreenResolutions_windows.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\GLideNUI\GLideNUI.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\GLideNUI\Settings.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Debug\moc_AboutDialog.cpp">
<Filter>Generated Files\Debug</Filter>
</ClCompile>
<ClCompile Include="Release\moc_AboutDialog.cpp">
<Filter>Generated Files\Release</Filter>
</ClCompile>
<ClCompile Include="Debug\moc_ConfigDialog.cpp">
<Filter>Generated Files\Debug</Filter>
</ClCompile>
<ClCompile Include="Release\moc_ConfigDialog.cpp">
<Filter>Generated Files\Release</Filter>
</ClCompile>
<ClCompile Include="GeneratedFiles\qrc_icon.cpp">
<Filter>Generated Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\GLideNUI\QtKeyToHID.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\SRC\GLideNUI\HIDKeyToName.cpp">
<Filter>Generated Files\Debug</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<CustomBuild Include="..\..\src\GLideNUI\AboutDialog.h">
<Filter>Header Files</Filter>
</CustomBuild>
<CustomBuild Include="..\..\src\GLideNUI\ConfigDialog.h">
<Filter>Header Files</Filter>
</CustomBuild>
<ClInclude Include="..\..\src\GLideNUI\FullscreenResolutions.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\GLideNUI\GLideNUI.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\GLideNUI\Settings.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<CustomBuild Include="..\..\src\GLideNUI\AboutDialog.ui">
<Filter>Form Files</Filter>
</CustomBuild>
<CustomBuild Include="..\..\src\GLideNUI\configDialog.ui">
<Filter>Form Files</Filter>
</CustomBuild>
</ItemGroup>
<ItemGroup>
<None Include="..\..\src\GLideNUI\Resources\Icon.ico">
<Filter>Resource Files</Filter>
</None>
<CustomBuild Include="..\..\src\GLideNUI\icon.qrc">
<Filter>Resource Files</Filter>
</CustomBuild>
</ItemGroup>
<ItemGroup>
<ClInclude Include="GeneratedFiles\ui_AboutDialog.h">
<Filter>Generated Files</Filter>
</ClInclude>
<ClInclude Include="GeneratedFiles\ui_configDialog.h">
<Filter>Generated Files</Filter>
</ClInclude>
</ItemGroup>
</Project>

View File

@ -46,7 +46,7 @@
<IntDir>$(SolutionDir)build\$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
<TargetName>libGLideNHQ</TargetName>
<TargetExt>.lib</TargetExt>
<OutDir>$(SolutionDir)bin\$(Platform)\$(Configuration)\lib\</OutDir>
<OutDir>$(SolutionDir)..\..\..\external\$(Platform)\</OutDir>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
@ -66,6 +66,12 @@
<PreprocessorDefinitions>%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<PropertyGroup Condition="'$(Configuration)'=='Release'">
<TargetName>libGLideNHQ</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Debug'">
<TargetName>libGLideNHQd</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'">
<ClCompile>
<AssemblerListingLocation>Debug/</AssemblerListingLocation>
@ -73,8 +79,8 @@
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
<Optimization>Disabled</Optimization>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PreprocessorDefinitions>_DEBUG;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PreprocessorDefinitions>DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Lib>
<AdditionalDependencies>libpngd.lib;zlibd.lib;</AdditionalDependencies>
@ -111,7 +117,7 @@
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<Optimization>MaxSpeed</Optimization>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Lib>
<AdditionalDependencies>libpng.lib;zlib.lib;</AdditionalDependencies>

View File

@ -50,6 +50,9 @@
<OutDir>$(SolutionDir)..\..\..\external\$(Platform)\</OutDir>
<IntDir>$(SolutionDir)build\$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<TargetExt>.lib</TargetExt>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<WarningLevel>Level3</WarningLevel>
@ -63,7 +66,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'">
<ClCompile>
<Optimization>Disabled</Optimization>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<ConformanceMode Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ConformanceMode>
<LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">stdcpp17</LanguageStandard>
<ConformanceMode Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ConformanceMode>
@ -98,4 +101,10 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
<PropertyGroup Condition="'$(Configuration)'=='Release'">
<TargetName>osal</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Debug'">
<TargetName>osald</TargetName>
</PropertyGroup>
</Project>

View File

@ -1,127 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\src\GLideNUI-wtl\ticpp\ticpp.cpp" />
<ClCompile Include="..\..\src\GLideNUI-wtl\ticpp\tinystr.cpp" />
<ClCompile Include="..\..\src\GLideNUI-wtl\ticpp\tinyxml.cpp" />
<ClCompile Include="..\..\src\GLideNUI-wtl\ticpp\tinyxmlerror.cpp" />
<ClCompile Include="..\..\src\GLideNUI-wtl\ticpp\tinyxmlparser.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\src\GLideNUI-wtl\ticpp\ticpp.h" />
<ClInclude Include="..\..\src\GLideNUI-wtl\ticpp\ticppapi.h" />
<ClInclude Include="..\..\src\GLideNUI-wtl\ticpp\ticpprc.h" />
<ClInclude Include="..\..\src\GLideNUI-wtl\ticpp\tinystr.h" />
<ClInclude Include="..\..\src\GLideNUI-wtl\ticpp\tinyxml.h" />
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{4F28B56B-F4B0-41B0-A785-597F6EF0163A}</ProjectGuid>
<RootNamespace>ticpp</RootNamespace>
</PropertyGroup>
<PropertyGroup Condition="'$(WindowsTargetPlatformVersion)'=='' and '$(VisualStudioVersion)' != '12.0' and '$(VisualStudioVersion)' != '14.0'">
<LatestTargetPlatformVersion>$([Microsoft.Build.Utilities.ToolLocationHelper]::GetLatestSDKTargetPlatformVersion('Windows', '10.0'))</LatestTargetPlatformVersion>
<WindowsTargetPlatformVersion>$(LatestTargetPlatformVersion)</WindowsTargetPlatformVersion>
<TargetPlatformVersion>$(WindowsTargetPlatformVersion)</TargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolSet>$(DefaultPlatformToolset)</PlatformToolSet>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration">
<UseDebugLibraries>true</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Release'" Label="Configuration">
<UseDebugLibraries>false</UseDebugLibraries>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<OutDir>$(SolutionDir)bin\$(Platform)\$(Configuration)\lib\</OutDir>
<IntDir>$(SolutionDir)build\$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>TIXML_USE_TICPP;_WINDOWS;WIN32;_DEBUG;_LIB;TIXML_USE_TICPP;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpp17</LanguageStandard>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>TIXML_USE_TICPP;_WINDOWS;WIN32;_DEBUG;_LIB;TIXML_USE_TICPP;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>TIXML_USE_TICPP;_WINDOWS;WIN32;NDEBUG;_LIB;TIXML_USE_TICPP;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>TIXML_USE_TICPP;_WINDOWS;WIN32;NDEBUG;_LIB;TIXML_USE_TICPP;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -1,51 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\src\GLideNUI-wtl\ticpp\ticpp.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\GLideNUI-wtl\ticpp\tinystr.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\GLideNUI-wtl\ticpp\tinyxml.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\GLideNUI-wtl\ticpp\tinyxmlerror.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\GLideNUI-wtl\ticpp\tinyxmlparser.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\src\GLideNUI-wtl\ticpp\ticpp.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\GLideNUI-wtl\ticpp\ticppapi.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\GLideNUI-wtl\ticpp\ticpprc.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\GLideNUI-wtl\ticpp\tinystr.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\GLideNUI-wtl\ticpp\tinyxml.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>

View File

@ -1,138 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{5480BC17-9C40-4E41-8AD4-AE12316D4CA4}</ProjectGuid>
<RootNamespace>ts2lang</RootNamespace>
</PropertyGroup>
<PropertyGroup Condition="'$(WindowsTargetPlatformVersion)'=='' and '$(VisualStudioVersion)' != '12.0' and '$(VisualStudioVersion)' != '14.0'">
<LatestTargetPlatformVersion>$([Microsoft.Build.Utilities.ToolLocationHelper]::GetLatestSDKTargetPlatformVersion('Windows', '10.0'))</LatestTargetPlatformVersion>
<WindowsTargetPlatformVersion>$(LatestTargetPlatformVersion)</WindowsTargetPlatformVersion>
<TargetPlatformVersion>$(WindowsTargetPlatformVersion)</TargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolSet>$(DefaultPlatformToolset)</PlatformToolSet>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<UseDebugLibraries>true</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<UseDebugLibraries>true</UseDebugLibraries>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<OutDir>$(SolutionDir)bin\$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)build\$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
<DisableFastUpToDateCheck>true</DisableFastUpToDateCheck>
</PropertyGroup>
<ItemDefinitionGroup>
<PostBuildEvent>
<Command>if not exist "../../translations/wtl" mkdir "../../translations/wtl"
"$(TargetDir)ts2lang.exe" "../../translations" "../../translations/wtl"</Command>
<Message>Converting .ts translations to .Lang...</Message>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpp17</LanguageStandard>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\src\GLideNUI-wtl\Language.cpp" />
<ClCompile Include="..\..\src\GLideNUI-wtl\util\ts2lang.cpp" />
<ClCompile Include="..\..\src\GLideNUI-wtl\util\md5.cpp" />
<ClCompile Include="..\..\src\GLideNUI-wtl\util\path.cpp" />
<ClCompile Include="..\..\src\GLideNUI-wtl\util\StdString.cpp" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="ticpp.vcxproj">
<Project>{4f28b56b-f4b0-41b0-a785-597f6ef0163a}</Project>
<UseLibraryDependencyInputs>true</UseLibraryDependencyInputs>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\src\GLideNUI-wtl\Language.h" />
<ClInclude Include="..\..\src\GLideNUI-wtl\util\md5.h" />
<ClInclude Include="..\..\src\GLideNUI-wtl\util\path.h" />
<ClInclude Include="..\..\src\GLideNUI-wtl\util\StdString.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -1,42 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<ClCompile Include="..\..\src\GLideNUI-wtl\util\md5.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\GLideNUI-wtl\util\path.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\GLideNUI-wtl\util\StdString.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\GLideNUI-wtl\util\ts2lang.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\GLideNUI-wtl\Language.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\src\GLideNUI-wtl\util\md5.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\GLideNUI-wtl\util\path.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\GLideNUI-wtl\util\StdString.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\GLideNUI-wtl\Language.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{3f27dc7e-8d4f-4179-815f-f9af8ff8d7c3}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{243e9857-b78f-490f-8b77-f3a387040f09}</UniqueIdentifier>
</Filter>
</ItemGroup>
</Project>

View File

@ -36,7 +36,7 @@ void Config::resetToDefaults()
texture.anisotropy = 0;
texture.maxAnisotropy = 0;
texture.bilinearMode = BILINEAR_STANDARD;
texture.bilinearMode = BILINEAR_3POINT;
texture.enableHalosRemoval = 0;
generalEmulation.enableLOD = 1;
@ -74,7 +74,7 @@ void Config::resetToDefaults()
frameBufferEmulation.copyToRDRAM = ctDoubleBuffer;
frameBufferEmulation.N64DepthCompare = dcDisable;
frameBufferEmulation.forceDepthBufferClear = 0;
frameBufferEmulation.aspect = a43;
frameBufferEmulation.aspect = aAdjust;
frameBufferEmulation.bufferSwapMode = bsOnVerticalInterrupt;
frameBufferEmulation.nativeResFactor = 0;
frameBufferEmulation.fbInfoReadColorChunk = 0;
@ -101,8 +101,8 @@ void Config::resetToDefaults()
textureFilter.txCacheCompression = 1;
textureFilter.txSaveCache = 1;
textureFilter.txEnhancedTextureFileStorage = 0;
textureFilter.txHiresTextureFileStorage = 0;
textureFilter.txEnhancedTextureFileStorage = 1;
textureFilter.txHiresTextureFileStorage = 1;
textureFilter.txNoTextureFileStorage = 0;
textureFilter.txHiresVramLimit = 0u;

View File

@ -1,403 +0,0 @@
#include "About.h"
#include "resource.h"
#include "Language.h"
extern HINSTANCE hInstance;
class CAboutContributersTab :
public CAboutTab
{
public:
BEGIN_MSG_MAP(CAboutContributersTab)
MSG_WM_INITDIALOG(OnInitDialog)
MESSAGE_HANDLER(WM_CTLCOLORDLG, OnColorStatic)
MESSAGE_HANDLER(WM_CTLCOLORSTATIC, OnColorStatic)
END_MSG_MAP()
CAboutContributersTab() :
CAboutTab(IDD_TAB_CONTRIBUTORS)
{
}
BOOL OnInitDialog(CWindow /*wndFocus*/, LPARAM /*lInitParam*/)
{
const TCHAR Contributors[] =
{
L"Logan McNaughton\r\n\r\n"
L"Francisco Zurita\r\n\r\n"
L"gizmo98\r\n\r\n"
L"purplemarshmallow\r\n\r\n"
L"zilmar\r\n\r\n"
L"matthewharvey\r\n\r\n"
L"lioncash\r\n\r\n"
L"Predator82Germany\r\n\r\n"
L"AmbientMalice\r\n\r\n"
L"baptiste0602\r\n\r\n"
L"Gilles Siberlin\r\n\r\n"
L"Daniel Eck\r\n\r\n"
L"Víctor \"IlDucci\"\r\n\r\n"
L"orbea\r\n\r\n"
L"BenjaminSiskoo\r\n\r\n"
L"ptitSeb\r\n\r\n"
L"Kimberly J.Ortega\r\n\r\n"
L"Maxime Morel\r\n\r\n"
L"tony971\r\n\r\n"
L"SigmaVirus\r\n\r\n"
L"Jools Wills\r\n\r\n"
L"Nekokabu\r\n\r\n"
L"nicklauslittle\r\n\r\n"
L"Nebuleon\r\n\r\n"
L"sergiobenrocha2\r\n\r\n"
L"Michał Durak\r\n\r\n"
L"Mushman"
};
GetDlgItem(IDC_CONTRIBUTORS).SetWindowText(Contributors);
return true;
}
LRESULT OnColorStatic(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)
{
if ((HWND)lParam == GetDlgItem(IDC_CONTRIBUTORS))
{
SetBkMode((HDC)wParam, TRANSPARENT);
return (LRESULT)GetSysColorBrush(COLOR_3DFACE);
}
return (LRESULT)GetStockObject(WHITE_BRUSH);
}
};
class CAboutFundersTab :
public CAboutTab
{
public:
BEGIN_MSG_MAP(CAboutFundersTab)
MSG_WM_INITDIALOG(OnInitDialog)
MESSAGE_HANDLER(WM_CTLCOLORDLG, OnColorStatic)
MESSAGE_HANDLER(WM_CTLCOLORSTATIC, OnColorStatic)
END_MSG_MAP()
CAboutFundersTab() :
CAboutTab(IDD_TAB_FUNDERS)
{
}
BOOL OnInitDialog(CWindow /*wndFocus*/, LPARAM /*lInitParam*/)
{
const TCHAR Funders1[] =
{
L"zolcos\r\n"
L"Mush Man\r\n"
L"nesplayer4life\r\n"
L"neko9876\r\n"
L"AnthonyHeathcoat\r\n"
L"daman6009\r\n"
L"Paul Lamb\r\n"
L"zilmar\r\n"
};
std::wstring FundersList =
{
L"Ryan Rosser\r\n"
L"Amadeus Sterl\r\n"
L"Narann\r\n"
L"camara_luiz\r\n"
L"weinerschnitzel\r\n"
L"microdev\r\n"
L"Thomas Ginelli\r\n"
L"ace977\r\n"
L"patryk.szalanski\r\n"
L"Detomine\r\n"
L"itasovski\r\n"
L"keithclark1985\r\n"
L"josephrmoore\r\n"
L"fckyourlies\r\n"
L"dougforr\r\n"
L"camdenfurse\r\n"
L"grandslam810\r\n"
L"rictic\r\n"
L"Fred Lambes\r\n"
L"David Vercruyssen\r\n"
L"danielgormly\r\n"
L"lukecool\r\n"
L"rhilsky\r\n"
L"phillipstuerzl\r\n"
L"killjoy1337\r\n"
L"ratop46\r\n"
L"william.a.moore\r\n"
L"RSP16\r\n"
L"kzidek127\r\n"
L"Dan Holberg\r\n"
L"178amm\r\n"
L"peterchrjoergensen\r\n"
L"hill_jm\r\n"
L"petercullenbryan\r\n"
L"Christopher M Rock\r\n"
L"Kenny.R.Mitchell\r\n"
L"Kevin Grasso\r\n"
L"mtgyure\r\n"
L"Anthony Heathcoat\r\n"
L"Liam Burns\r\n"
L"Steven Impson\r\n"
L"Gwyn.Whieldon\r\n"
L"hipnotoad\r\n"
L"shmuklidooha\r\n"
L"bcanard123\r\n"
L"Ben Slater\r\n"
L"Mike Nagy\r\n"
L"littlegreendude55\r\n"
L"Jay Loring\r\n"
L"Damion D\r\n"
L"heranbago\r\n"
L"baptiste.guilbert\r\n"
L"shadowpower69\r\n"
L"j.mcguirk72\r\n"
L"Peter Greenwood\r\n"
L"fla56\r\n"
L"Sergio\r\n"
L"theboy_181\r\n"
L"Jindo Fox\r\n"
L"s1n.pcc\r\n"
L"rafaelvasco\r\n"
L"copileo\r\n"
L"hugues.fabien\r\n"
L"seanmcm157\r\n"
L"David Morris\r\n"
L"Jason Lightner\r\n"
L"olivier_crepin77\r\n"
L"Paul Lamb\r\n"
L"thegump2.0\r\n"
L"Bates\r\n"
L"cdoublejj\r\n"
L"buddybenj\r\n"
L"don.carmical\r\n"
L"kyussgreen\r\n"
L"info1092\r\n"
L"YQ\r\n"
L"Allan Nordhøy\r\n"
L"christian010\r\n"
L"creuseur2patateradio\r\n"
L"chrisbevanlee\r\n"
L"theschklingen\r\n"
L"Thomas Lindstrøm\r\n"
L"Djipi\r\n"
L"Dartus\r\n"
L"Oscar Abraham\r\n"
L"nwstrathdee\r\n"
L"will7046\r\n"
L"Richard42\r\n"
L"V1del\r\n"
L"AnthonyBentley\r\n"
L"buddybenj\r\n"
L"nickshooter251\r\n"
L"sicurella12\r\n"
L"jcspringer\r\n"
L"Gru So\r\n"
L"Vinícius dos Santos Oliveira\r\n"
L"Jimmy Haugh\r\n"
L"Malcolm\r\n"
L"Alex Strange\r\n"
L"Espen Jensen\r\n"
L"m.johnsondelta\r\n"
L"alexzandar.toxic2\r\n"
L"Ben Slater\r\n"
L"WC-Predator\r\n"
L"Mush Man\r\n"
L"Ben Slater\r\n"
L"aznlucidx\r\n"
L"Nathan Dick\r\n"
L"paulanocom\r\n"
L"Ryan Rosser\r\n"
L"nekow42\r\n"
L"mgos1\r\n"
L"ian.macdonald996\r\n"
L"itasovski\r\n"
L"vikingpower1\r\n"
L"DukeX007X\r\n"
L"palaciosgabriel\r\n"
L"Franz-Josef Haider\r\n"
L"e-male\r\n"
L"aweath\r\n"
L"famicom4\r\n"
L"Keith_at_UMR\r\n"
L"sweatypickle\r\n"
L"jeremydmiller\r\n\r\n"
};
FundersList += wGS(ABOUT_AND_MORE);
CWindow Funders = GetDlgItem(IDC_FUNDERS);
Funders.SetWindowText(Funders1);
m_SubtitleFont.Apply(m_hWnd, CWindowFont::typeBold | CWindowFont::typeSubheading, IDC_FUNDERS);
GetDlgItem(IDC_FUNDERS_LIST).SetWindowText(FundersList.c_str());
return true;
};
LRESULT OnColorStatic(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)
{
if ((HWND)lParam == GetDlgItem(IDC_FUNDERS_LIST))
{
SetBkMode((HDC)wParam, TRANSPARENT);
return (LRESULT)GetSysColorBrush(COLOR_3DFACE);
}
return (LRESULT)GetStockObject(WHITE_BRUSH);
}
};
class CAboutCreditsTab :
public CAboutTab
{
public:
BEGIN_MSG_MAP(CAboutCreditsTab)
MSG_WM_INITDIALOG(OnInitDialog)
MESSAGE_HANDLER(WM_CTLCOLORDLG, OnColorStatic)
MESSAGE_HANDLER(WM_CTLCOLORSTATIC, OnColorStatic)
END_MSG_MAP()
CAboutCreditsTab() :
CAboutTab(IDD_TAB_CREDITS)
{
}
BOOL OnInitDialog(CWindow /*wndFocus*/, LPARAM /*lInitParam*/)
{
SetDlgItemTextW(IDC_TXT_AUTHOR_GLN64, wGS(ABOUT_AUTHOR_GLN64).c_str());
SetDlgItemTextW(IDC_TXT_AUTHOR_GLES2N64, wGS(ABOUT_AUTHOR_GLES2N64).c_str());
SetDlgItemTextW(IDC_TXT_AUTHOR_GLIDEHQ, wGS(ABOUT_AUTHOR_GLIDEHQ).c_str());
SetDlgItemTextW(IDC_TXT_AUTHOR_Z64, wGS(ABOUT_AUTHOR_Z64).c_str());
const UINT Creditors[] =
{
IDC_ORKIN,
IDC_YONGZH,
IDC_HIROSHI,
IDC_ZIGGY
};
for (const UINT &Creditor : Creditors) {
m_SubtitleFont.Apply(m_hWnd, CWindowFont::typeBold | CWindowFont::typeSubheading, Creditor);
}
return true;
};
};
CAboutTab::CAboutTab(uint32_t _IDD) :
IDD(_IDD)
{
}
CAboutTab::~CAboutTab()
{
}
BOOL CAboutTab::OnInitDialog(CWindow /*wndFocus*/, LPARAM /*lInitParam*/)
{
SetDlgItemTextW(IDC_TXT_NEW_GEN, wGS(ABOUT_NEXT_GENERATION).c_str());
SetDlgItemTextW(IDC_TXT_AUTHORS, wGS(ABOUT_AUTHORS).c_str());
SetDlgItemTextW(IDC_TXT_DEVELOPER, wGS(ABOUT_DEVELOPER).c_str());
SetDlgItemTextW(IDC_TXT_BETA_TESTER, wGS(ABOUT_BETA_TESTER).c_str());
SetDlgItemTextW(IDC_TXT_GUI_DESIGNER, wGS(ABOUT_GUI_DESIGNER).c_str());
const UINT Authors[] =
{
IDC_SERGEY,
IDC_OLIVIER,
IDC_RYAN
};
for (const UINT &Author : Authors) {
m_SubtitleFont.Apply(m_hWnd, CWindowFont::typeBold | CWindowFont::typeSubheading, Author);
}
return true;
}
LRESULT CAboutTab::OnColorStatic(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
return (LRESULT)GetStockObject(WHITE_BRUSH);
}
CAboutDlg::~CAboutDlg()
{
for (size_t i = 0, n = m_TabWindows.size(); i < n; i++)
{
delete m_TabWindows[i];
}
m_TabWindows.clear();
}
LRESULT CAboutDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/ , LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
SetWindowText(wGS(ABOUT_ABOUT_TITLE).c_str());
HICON hIcon = AtlLoadIconImage(IDI_APPICON, LR_DEFAULTCOLOR, ::GetSystemMetrics(SM_CXICON), ::GetSystemMetrics(SM_CYICON));
SetIcon(hIcon, TRUE);
HICON hIconSmall = AtlLoadIconImage(IDI_APPICON, LR_DEFAULTCOLOR, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON));
SetIcon(hIconSmall, FALSE);
SIZEF dpiScale = DpiScale(m_hWnd);
SIZE iconSz = { (LONG)(48 * dpiScale.cx), (LONG)(48 * dpiScale.cy) };
m_TitleFont.Apply(m_hWnd, CWindowFont::typeBold | CWindowFont::typeHeading, IDC_ABOUT_TITLE);
m_AboutIcon.SubclassWindow(GetDlgItem(IDC_ABOUT_ICON));
if (dpiScale.cx > 1.0 || dpiScale.cy > 1.0) {
m_AboutIcon.SetIcon(MAKEINTRESOURCE(IDI_APPICON), 256, 256); //load hi-def icon
}
else {
m_AboutIcon.SetIcon(MAKEINTRESOURCE(IDI_APPICON), 48, 48); //load regular icon
}
m_AboutIcon.SetWindowPos(HWND_TOP, 0, 0, iconSz.cx, iconSz.cy, SWP_NOMOVE | SWP_NOZORDER);
m_Tabs.Attach(GetDlgItem(IDC_TABS));
AddTab(wGS(ABOUT_TAB_ABOUT).c_str(), new CAboutTab(IDD_TAB_ABOUT));
AddTab(wGS(ABOUT_TAB_CONTRIBUTORS).c_str(), new CAboutContributersTab);
AddTab(wGS(ABOUT_TAB_FUNDERS).c_str(), new CAboutFundersTab);
AddTab(wGS(ABOUT_TAB_CREDITS).c_str(), new CAboutCreditsTab);
return 0;
}
CRect CAboutDlg::GetTabRect()
{
CRect TabRect;
m_Tabs.GetWindowRect(&TabRect);
ScreenToClient(&TabRect);
m_Tabs.AdjustRect(FALSE, &TabRect);
return TabRect;
}
void CAboutDlg::AddTab(const wchar_t * caption, CAboutTab * tab)
{
m_Tabs.AddItem(caption);
tab->Create(m_hWnd, 0);
tab->SetWindowPos(m_hWnd, 0, 0, 0, 0, SWP_HIDEWINDOW);
m_TabWindows.push_back(tab);
if (m_TabWindows.size() == 1)
{
ShowTab(0);
}
}
void CAboutDlg::ShowTab(int nPage)
{
for (size_t i = 0; i < m_TabWindows.size(); i++)
{
m_TabWindows[i]->ShowWindow(SW_HIDE);
}
CRect TabRect = GetTabRect();
m_TabWindows[nPage]->SetWindowPos(HWND_TOP, TabRect.left, TabRect.top, TabRect.Width(), TabRect.Height(), SWP_SHOWWINDOW);
CRect WinRect, ClientRect;
m_TabWindows[nPage]->GetWindowRect(WinRect);
m_TabWindows[nPage]->GetClientRect(ClientRect);
m_Tabs.RedrawWindow();
}
LRESULT CAboutDlg::OnTabChange(NMHDR* /*pNMHDR*/)
{
ShowTab(m_Tabs.GetCurSel());
return FALSE;
}
LRESULT CAboutDlg::OnOK(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
EndDialog(wID);
return 0;
}
LRESULT CAboutDlg::OnCancel(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
EndDialog(wID);
return 0;
}

View File

@ -1,60 +0,0 @@
#pragma once
#include "wtl.h"
#include "wtl-WindowFont.h"
#include "wtl-BitmapPicture.h"
#include "resource.h"
#include <vector>
class CAboutTab :
public CDialogImpl<CAboutTab>
{
public:
CAboutTab(uint32_t _IDD);
virtual ~CAboutTab();
BEGIN_MSG_MAP(CAboutTab)
MSG_WM_INITDIALOG(OnInitDialog)
MESSAGE_HANDLER(WM_CTLCOLORDLG, OnColorStatic)
MESSAGE_HANDLER(WM_CTLCOLORSTATIC, OnColorStatic)
END_MSG_MAP()
uint32_t IDD;
protected:
BOOL OnInitDialog(CWindow wndFocus, LPARAM lInitParam);
LRESULT OnColorStatic(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
CWindowFont m_SubtitleFont;
};
class CAboutDlg :
public CDialogImpl<CAboutDlg>
{
public:
~CAboutDlg();
enum { IDD = IDD_ABOUT };
BEGIN_MSG_MAP_EX(CAboutDlg)
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
COMMAND_ID_HANDLER(IDOK, OnOK)
COMMAND_ID_HANDLER(IDCANCEL, OnCancel)
NOTIFY_HANDLER_EX(IDC_TABS, TCN_SELCHANGE, OnTabChange)
END_MSG_MAP()
protected:
LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
LRESULT OnOK(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
LRESULT OnCancel(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
LRESULT OnTabChange(NMHDR* pNMHDR);
void AddTab(const wchar_t * caption, CAboutTab *);
void ShowTab(int nPage);
CRect GetTabRect();
CWindowFont m_TitleFont;
CBitmapPicture m_AboutIcon;
CTabCtrl m_Tabs;
std::vector<CAboutTab *> m_TabWindows;
};

View File

@ -1,450 +0,0 @@
#pragma once
#include "wtl.h"
#include "ConfigDlg.h"
#include "../Config.h"
#include "Settings.h"
#include "config-video.h"
#include "config-emulation.h"
#include "config-framebuffer.h"
#include "config-texture.h"
#include "config-osd.h"
#include "config-debug.h"
#include "util/util.h"
#include "InputDialog.h"
#include "Language.h"
CConfigDlg::CConfigDlg() :
m_blockReInit(false),
m_EmulationTab(NULL),
m_Saved(false),
m_TabLeft(0),
m_ProfileLeft(0)
{
}
CConfigDlg::~CConfigDlg() {
m_EmulationTab = NULL;
for (size_t i = 0; i < m_TabWindows.size(); i++)
delete m_TabWindows[i];
m_TabWindows.clear();
}
void CConfigDlg::setIniPath(const std::string & IniPath) {
m_strIniPath = IniPath;
}
void CConfigDlg::setRomName(const char * RomName) {
m_romName = RomName == NULL || strlen(RomName) == 0 ? NULL : RomName;
}
void CConfigDlg::setMSAALevel(uint32_t _maxMSAALevel) {
m_maxMSAALevel = _maxMSAALevel;
}
uint32_t CConfigDlg::getMSAALevel() const {
return m_maxMSAALevel;
}
void CConfigDlg::setMaxAnisotropy(uint32_t _maxAnisotropy)
{
m_maxAnisotropy = _maxAnisotropy;
}
uint32_t CConfigDlg::getMaxAnisotropy() const
{
return m_maxAnisotropy;
}
LRESULT CConfigDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) {
HICON hIcon = AtlLoadIconImage(IDI_APPICON, LR_DEFAULTCOLOR, ::GetSystemMetrics(SM_CXICON), ::GetSystemMetrics(SM_CYICON));
SetIcon(hIcon, TRUE);
HICON hIconSmall = AtlLoadIconImage(IDI_APPICON, LR_DEFAULTCOLOR, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON));
SetIcon(hIconSmall, FALSE);
m_FrameBufferTab = new CFrameBufferTab();
m_VideoTab = new CVideoTab(*this, *m_FrameBufferTab, m_strIniPath.c_str());
m_EmulationTab = new CEmulationTab(*this);
m_OsdTab = new COsdTab();
m_Tabs.Attach(GetDlgItem(IDC_TABS));
AddTab(TAB_VIDEO, m_VideoTab);
AddTab(TAB_EMULATION, m_EmulationTab);
AddTab(TAB_FRAME_BUFFER, m_FrameBufferTab);
AddTab(TAB_TEXTURE_ENHANCEMENT, new CTextureEnhancementTab);
AddTab(TAB_OSD, m_OsdTab);
#ifdef DEBUG_DUMP
AddTab(TAB_DEBUG, new CDebugTab);
#endif
RECT Rect;
GetDlgItem(IDC_TABS).GetWindowRect(&Rect);
::MapWindowPoints(NULL, m_hWnd, (LPPOINT)&Rect, 2);
m_TabLeft = Rect.left;
if (m_romName != NULL) {
std::wstring RomName(ToUTF16(m_romName));
CWindow dlgItem = GetDlgItem(IDC_GAME_PROFILE_NAME);
CDC dc;
dc.CreateCompatibleDC(NULL);
dc.SelectFont(dlgItem.GetFont());
SIZE size;
dc.GetTextExtent(RomName.c_str(), static_cast<int>(RomName.length()), &size);
RECT Rect;
dlgItem.GetWindowRect(&Rect);
::MapWindowPoints(NULL, m_hWnd, (LPPOINT)&Rect, 2);
Rect.right = Rect.left + size.cx;
dlgItem.MoveWindow(&Rect);
dlgItem.SetWindowText(RomName.c_str());
m_ProfileLeft = Rect.right + 10;
CButton(GetDlgItem(IDC_GAME_PROFILE)).SetCheck(BST_CHECKED);
CButton(GetDlgItem(IDC_USE_PROFILE)).SetCheck(BST_UNCHECKED);
} else {
CButton(GetDlgItem(IDC_GAME_PROFILE)).SetCheck(BST_UNCHECKED);
CButton(GetDlgItem(IDC_USE_PROFILE)).SetCheck(BST_CHECKED);
GetDlgItem(IDC_SETTINGS_PROFILE_STATIC).GetWindowRect(&Rect);
::MapWindowPoints(NULL, m_hWnd, (LPPOINT)&Rect, 2);
m_ProfileLeft = Rect.left;
}
ProfileList Profiles = getProfiles(m_strIniPath.c_str());
std::string CurrentProfile = getCurrentProfile(m_strIniPath.c_str());
CComboBox profilesComboBox(GetDlgItem(IDC_PROFILE));
profilesComboBox.ResetContent();
for (ProfileList::const_iterator itr = Profiles.begin(); itr != Profiles.end(); itr++) {
int Index = profilesComboBox.AddString(ToUTF16(itr->c_str()).c_str());
if (CurrentProfile == *itr)
profilesComboBox.SetCurSel(Index);
}
profilesComboBox.AddString(L"New...");
GetDlgItem(IDC_REMOVE_PROFILE).EnableWindow(profilesComboBox.GetCount() > 2);
Init();
return 0;
}
void CConfigDlg::OnCustomSettingsToggled(bool checked) {
if (m_hWnd == NULL)
return;
checked = m_romName != NULL ? checked : false;
GetDlgItem(IDC_GAME_PROFILE).ShowWindow(checked ? SW_SHOWNORMAL : SW_HIDE);
GetDlgItem(IDC_SAVE_SETTINGS_STATIC).ShowWindow(checked ? SW_SHOWNORMAL : SW_HIDE);
GetDlgItem(IDC_GAME_PROFILE_NAME).ShowWindow(checked ? SW_SHOWNORMAL : SW_HIDE);
GetDlgItem(IDC_USE_PROFILE).ShowWindow(checked ? SW_SHOWNORMAL : SW_HIDE);
int32_t Move = 0;
if (checked) {
RECT Rect;
CWindow UseProfile = GetDlgItem(IDC_USE_PROFILE);
UseProfile.GetWindowRect(&Rect);
::MapWindowPoints(NULL, m_hWnd, (LPPOINT)&Rect, 2);
Move = Rect.left - m_ProfileLeft;
if (Move != 0) {
Rect.left -= Move;
Rect.right -= Move;
UseProfile.MoveWindow(&Rect);
}
uint32_t Left = Rect.right + 2;
CWindow ProfileStatic = GetDlgItem(IDC_SETTINGS_PROFILE_STATIC);
ProfileStatic.GetWindowRect(&Rect);
::MapWindowPoints(NULL, m_hWnd, (LPPOINT)&Rect, 2);
Move = Rect.left - Left;
} else {
RECT Rect;
GetDlgItem(IDC_SETTINGS_PROFILE_STATIC).GetWindowRect(&Rect);
::MapWindowPoints(NULL, m_hWnd, (LPPOINT)&Rect, 2);
Move = Rect.left - m_TabLeft;
}
if (Move != 0) {
int nID[] = {
IDC_SETTINGS_PROFILE_STATIC,
IDC_PROFILE,
IDC_REMOVE_PROFILE,
};
RECT Rect;
GetDlgItem(nID[0]).GetWindowRect(&Rect);
::MapWindowPoints(NULL, m_hWnd, (LPPOINT)&Rect, 2);
for (size_t i = 0, n = sizeof(nID) / sizeof(nID[0]); i < n; i++) {
CWindow window = GetDlgItem(nID[i]);
window.GetWindowRect(&Rect);
::MapWindowPoints(NULL, m_hWnd, (LPPOINT)&Rect, 2);
Rect.left -= Move;
Rect.right -= Move;
window.MoveWindow(&Rect);
}
}
}
LRESULT CConfigDlg::OnProfileChanged(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hwnd*/, BOOL& /*bHandled*/) {
CComboBox profilesComboBox(GetDlgItem(IDC_PROFILE));
int nIndex = profilesComboBox.GetCurSel();
if (nIndex < 0) { return 0; }
int nLen = profilesComboBox.GetLBTextLen(nIndex);
if (nLen == CB_ERR) { return FALSE; }
std::wstring Profile;
Profile.resize(nLen);
profilesComboBox.GetLBText(nIndex, (wchar_t *)Profile.data());
CButton(GetDlgItem(IDC_USE_PROFILE)).SetCheck(BST_CHECKED);
CButton(GetDlgItem(IDC_GAME_PROFILE)).SetCheck(BST_UNCHECKED);
if (Profile == L"New...") {
bool ok;
std::string switchToProfile = getCurrentProfile(m_strIniPath.c_str());
std::string newProfile = FromUTF16(CInputDialog::getText(L"New Profile", L"New profile name:", ok).c_str());
CComboBox profilesComboBox(GetDlgItem(IDC_PROFILE));
if (ok) {
ProfileList Profiles = getProfiles(m_strIniPath.c_str());
if (strcmp(newProfile.c_str(), "New...") == 0) {
MessageBox(L"New settings profiles cannot be called \"New...\".", L"New Profile", MB_OK | MB_ICONWARNING);
}
else if (newProfile.empty()) {
MessageBox(L"Please type a name for your new settings profile.", L"New Profile", MB_OK | MB_ICONWARNING);
}
else if (Profiles.find(newProfile.c_str()) != Profiles.end()) {
MessageBox(L"This settings profile already exists.", L"New Profile", MB_OK | MB_ICONWARNING);
} else {
profilesComboBox.AddString(ToUTF16(newProfile.c_str()).c_str());
addProfile(m_strIniPath.c_str(), newProfile.c_str());
GetDlgItem(IDC_REMOVE_PROFILE).EnableWindow(profilesComboBox.GetCount() > 2);
switchToProfile = newProfile;
}
}
for (int i = 0, n = profilesComboBox.GetCount(); i < n; ++i) {
std::wstring Profile;
Profile.resize(profilesComboBox.GetLBTextLen(i) + 1);
profilesComboBox.GetLBText(i, (wchar_t *)Profile.data());
if (strcmp(FromUTF16(Profile.c_str()).c_str(),switchToProfile.c_str()) == 0) {
profilesComboBox.SetCurSel(i);
break;
}
}
return 0;
}
changeProfile(m_strIniPath.c_str(), FromUTF16(Profile.c_str()).c_str());
Init(true);
return 0;
}
void CConfigDlg::SaveSettings() {
m_Saved = true;
for (size_t i = 0; i < m_TabWindows.size(); i++)
m_TabWindows[i]->SaveSettings();
if (config.generalEmulation.enableCustomSettings && CButton(GetDlgItem(IDC_GAME_PROFILE)).GetCheck() == BST_CHECKED && m_romName != nullptr)
saveCustomRomSettings(m_strIniPath.c_str(), m_romName);
else
writeSettings(m_strIniPath.c_str());
Init(true);
}
LRESULT CConfigDlg::OnRestoreDefaults(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) {
int Res = MessageBox(L"Are you sure you want to reset all settings to default?", L"Restore Defaults?", MB_YESNO | MB_ICONWARNING);
if (Res == IDYES) {
const u32 enableCustomSettings = config.generalEmulation.enableCustomSettings;
config.resetToDefaults();
config.generalEmulation.enableCustomSettings = enableCustomSettings;
setRomName(m_romName);
Init();
}
return 0;
}
LRESULT CConfigDlg::OnGameProfile(UINT /*Code*/, int /*id*/, HWND /*ctl*/) {
CButton(GetDlgItem(IDC_USE_PROFILE)).SetCheck(BST_UNCHECKED);
Init(true, true);
return 0;
}
LRESULT CConfigDlg::OnUseProfile(UINT /*Code*/, int /*id*/, HWND /*ctl*/) {
CButton(GetDlgItem(IDC_GAME_PROFILE)).SetCheck(BST_UNCHECKED);
Init(true, true);
return 0;
}
LRESULT CConfigDlg::OnRemoveProfile(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) {
CComboBox profilesComboBox(GetDlgItem(IDC_PROFILE));
if (profilesComboBox.GetCount() <= 2)
return 0;
int nIndex = profilesComboBox.GetCurSel();
std::wstring profile;
profile.resize(profilesComboBox.GetLBTextLen(nIndex) + 1);
profilesComboBox.GetLBText(nIndex, (wchar_t *)profile.data());
ProfileList Profiles = getProfiles(m_strIniPath.c_str());
if (Profiles.find(FromUTF16(profile.c_str()).c_str()) == Profiles.end())
return 0;
std::wstring msg = L"Are you sure you want to remove the settings profile \"";
msg += profile.c_str();
msg += L"\"?";
if (MessageBox(msg.c_str(), L"Remove Profile", MB_YESNO | MB_ICONWARNING) == IDYES) {
removeProfile(m_strIniPath.c_str(), FromUTF16(profile.c_str()).c_str());
for (int i = 0, n = profilesComboBox.GetCount(); i < n; ++i) {
std::wstring ProfileItem;
ProfileItem.resize(profilesComboBox.GetLBTextLen(i) + 1);
profilesComboBox.GetLBText(i, (wchar_t *)ProfileItem.data());
if (wcscmp(ProfileItem.c_str(),profile.c_str()) == 0) {
profilesComboBox.DeleteString(i);
break;
}
}
for (int i = 0, n = profilesComboBox.GetCount(); i < n; ++i) {
std::wstring ProfileItem;
ProfileItem.resize(profilesComboBox.GetLBTextLen(i) + 1);
profilesComboBox.GetLBText(i, (wchar_t *)ProfileItem.data());
if (wcscmp(ProfileItem.c_str(),L"New...") != 0) {
profilesComboBox.SetCurSel(i);
changeProfile(m_strIniPath.c_str(), FromUTF16(ProfileItem.c_str()).c_str());
Init(true);
break;
}
}
GetDlgItem(IDC_REMOVE_PROFILE).EnableWindow(profilesComboBox.GetCount() > 2);
}
return 0;
}
LRESULT CConfigDlg::OnSaveClose(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/) {
SaveSettings();
EndDialog(wID);
return 0;
}
LRESULT CConfigDlg::OnSave(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) {
SaveSettings();
return 0;
}
LRESULT CConfigDlg::OnTabChange(NMHDR* /*pNMHDR*/) {
ShowTab(m_Tabs.GetCurSel());
return FALSE;
}
LRESULT CConfigDlg::OnCancel(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/) {
EndDialog(wID);
return 0;
}
void CConfigDlg::Init(bool reInit, bool blockCustomSettings) {
if (m_blockReInit)
return;
m_blockReInit = true;
bool CustomSettings = m_EmulationTab != NULL && CButton(m_EmulationTab->GetDlgItem(IDC_CHK_USE_PER_GAME)).GetCheck() == BST_CHECKED;
if (reInit && m_romName != NULL && CustomSettings && CButton(GetDlgItem(IDC_GAME_PROFILE)).GetCheck() == BST_CHECKED) {
loadCustomRomSettings(m_strIniPath.c_str(), m_romName);
} else if (reInit) {
loadSettings(m_strIniPath.c_str());
}
for (size_t i = 0; i < m_TabWindows.size(); i++)
m_TabWindows[i]->LoadSettings(blockCustomSettings);
for (size_t i = 0; i < m_TabWindows.size(); i++)
m_TabWindows[i]->ApplyLanguage();
ApplyLanguage();
m_blockReInit = false;
}
CRect CConfigDlg::GetTabRect() {
CRect TabRect;
m_Tabs.GetWindowRect(&TabRect);
ScreenToClient(&TabRect);
m_Tabs.AdjustRect(FALSE, &TabRect);
return TabRect;
}
void CConfigDlg::AddTab(languageStringID caption, CConfigTab * tab) {
m_Tabs.AddItem(TCIF_TEXT | TCIF_PARAM, wGS(caption).c_str(), 0, caption);
tab->Create(m_hWnd, 0);
tab->SetWindowPos(m_hWnd, 0, 0, 0, 0, SWP_HIDEWINDOW);
m_TabWindows.push_back(tab);
if (m_TabWindows.size() == 1)
ShowTab(0);
}
void CConfigDlg::ShowTab(int nPage) {
if (nPage == 4 && !m_OsdTab->m_FontsLoaded) { // OSD tab
m_OsdTab->LoadFonts();
}
for (size_t i = 0; i < m_TabWindows.size(); i++)
m_TabWindows[i]->ShowWindow(SW_HIDE);
CRect TabRect = GetTabRect();
m_TabWindows[nPage]->SetWindowPos(HWND_TOP, TabRect.left, TabRect.top, TabRect.Width(), TabRect.Height(), SWP_SHOWWINDOW);
CRect WinRect, ClientRect;
m_TabWindows[nPage]->GetWindowRect(WinRect);
m_TabWindows[nPage]->GetClientRect(ClientRect);
m_Tabs.RedrawWindow();
}
void CConfigDlg::SetLanguage(const std::string & language) {
LoadCurrentStrings(m_strIniPath.c_str(), language);
for (int i = 0, n = m_Tabs.GetItemCount(); i < n; i++) {
TCITEM tci = { 0 };
tci.mask = TCIF_PARAM;
m_Tabs.GetItem(i, &tci);
if (tci.lParam != 0) {
tci.mask = TCIF_TEXT;
std::wstring caption = wGS((languageStringID)tci.lParam);
tci.pszText = (LPWSTR)caption.c_str();
m_Tabs.SetItem(i, &tci);
}
}
for (size_t i = 0; i < m_TabWindows.size(); i++)
m_TabWindows[i]->ApplyLanguage();
ApplyLanguage();
}
void CConfigDlg::ApplyLanguage(void)
{
SetDlgItemTextW(IDC_SAVE_SETTINGS_STATIC, wGS(CFG_SAVE_SETTINGS_FOR).c_str());
SetDlgItemTextW(IDC_SETTINGS_PROFILE_STATIC, wGS(CFG_SETTINGS_PROFILE).c_str());
SetDlgItemTextW(IDC_REMOVE_PROFILE, wGS(CFG_REMOVE).c_str());
SetDlgItemTextW(ID_RESTORE_DEFAULTS, wGS(CFG_RESTORE_DEFAULTS).c_str());
SetDlgItemTextW(ID_SAVECLOSE, wGS(CFG_SAVE_AND_CLOSE).c_str());
SetDlgItemTextW(ID_SAVE, wGS(CFG_SAVE).c_str());
SetDlgItemTextW(IDCANCEL, wGS(CFG_CLOSE).c_str());
}
class GlideN64WtlModule :
public CAppModule
{
public:
GlideN64WtlModule(HINSTANCE hinst) {
Init(NULL, hinst);
}
virtual ~GlideN64WtlModule(void) {
Term();
}
};
GlideN64WtlModule * WtlModule = NULL;
void ConfigInit(void * hinst) {
WtlModule = new GlideN64WtlModule((HINSTANCE)hinst);
}
void ConfigCleanup(void) {
if (WtlModule) {
delete WtlModule;
WtlModule = NULL;
}
}

View File

@ -1,83 +0,0 @@
#pragma once
#include <string>
#include "wtl.h"
#include "config-tab.h"
#include "language.h"
#include "resource.h"
#include <vector>
class CFrameBufferTab;
class CVideoTab;
class CEmulationTab;
class COsdTab;
class CConfigDlg :
public CDialogImpl<CConfigDlg>
{
public:
CConfigDlg();
~CConfigDlg();
enum { IDD = IDD_CONFIG };
BEGIN_MSG_MAP_EX(CConfigDlg)
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
NOTIFY_HANDLER_EX(IDC_TABS, TCN_SELCHANGE, OnTabChange)
COMMAND_HANDLER(IDC_PROFILE, CBN_SELCHANGE, OnProfileChanged)
COMMAND_HANDLER_EX(IDC_GAME_PROFILE, BN_CLICKED, OnGameProfile)
COMMAND_HANDLER_EX(IDC_USE_PROFILE, BN_CLICKED, OnUseProfile)
COMMAND_ID_HANDLER(IDC_REMOVE_PROFILE, OnRemoveProfile)
COMMAND_ID_HANDLER(ID_RESTORE_DEFAULTS, OnRestoreDefaults)
COMMAND_ID_HANDLER(ID_SAVECLOSE, OnSaveClose)
COMMAND_ID_HANDLER(ID_SAVE, OnSave)
COMMAND_ID_HANDLER(IDCANCEL, OnCancel)
END_MSG_MAP()
void setIniPath(const std::string & IniPath);
void setRomName(const char * RomName);
void setMSAALevel(uint32_t _maxMSAALevel);
uint32_t getMSAALevel() const;
void setMaxAnisotropy(uint32_t _maxAnisotropy);
uint32_t getMaxAnisotropy() const;
bool Saved(void) const { return m_Saved; }
void OnCustomSettingsToggled(bool checked);
void SetLanguage(const std::string & language);
protected:
LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
LRESULT OnRemoveProfile(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
LRESULT OnRestoreDefaults(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
LRESULT OnSaveClose(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
LRESULT OnSave(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
LRESULT OnCancel(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
LRESULT OnTabChange(NMHDR* pNMHDR);
LRESULT OnProfileChanged(WORD wNotifyCode, WORD wID, HWND hwnd, BOOL& bHandled);
LRESULT OnGameProfile(UINT /*Code*/, int id, HWND /*ctl*/);
LRESULT OnUseProfile(UINT /*Code*/, int id, HWND /*ctl*/);
void Init(bool reInit = false, bool blockCustomSettings = false);
void AddTab(languageStringID StringID, CConfigTab * tab);
void ShowTab(int nPage);
CRect GetTabRect();
void SaveSettings();
void ApplyLanguage();
CTabCtrl m_Tabs;
std::vector<CConfigTab *> m_TabWindows;
std::string m_strIniPath;
const char * m_romName;
uint32_t m_maxMSAALevel;
uint32_t m_maxAnisotropy;
bool m_blockReInit;
CFrameBufferTab * m_FrameBufferTab;
CVideoTab * m_VideoTab;
CEmulationTab * m_EmulationTab;
COsdTab * m_OsdTab;
uint32_t m_TabLeft, m_ProfileLeft;
bool m_Saved;
};
#ifdef _WIN32
void ConfigInit(void * hinst);
void ConfigCleanup(void);
#endif

View File

@ -1,166 +0,0 @@
#include "FontInfo.h"
#include "FileClass.h"
#include <stdint.h>
#include <memory>
#include <vector>
#include <Windows.h>
#include <Shlobj.h>
#pragma warning(disable:4996)
typedef struct _tagTT_OFFSET_TABLE
{
uint16_t uMajorVersion;
uint16_t uMinorVersion;
uint16_t uNumOfTables;
uint16_t uSearchRange;
uint16_t uEntrySelector;
uint16_t uRangeShift;
} TT_OFFSET_TABLE;
typedef struct _tagTT_TABLE_DIRECTORY
{
char szTag[4]; //table name
uint32_t uCheckSum; //Check sum
uint32_t uOffset; //Offset from beginning of file
uint32_t uLength; //length of the table in bytes
} TT_TABLE_DIRECTORY;
typedef struct _tagTT_NAME_TABLE_HEADER
{
uint16_t uFSelector; //format selector. Always 0
uint16_t uNRCount; //Name Records count
uint16_t uStorageOffset; //Offset for strings storage, from start of the table
} TT_NAME_TABLE_HEADER;
typedef struct _tagTT_NAME_RECORD
{
uint16_t uPlatformID;
uint16_t uEncodingID;
uint16_t uLanguageID;
uint16_t uNameID;
uint16_t uStringLength;
uint16_t uStringOffset; //from start of storage area
} TT_NAME_RECORD;
#define SWAPWORD(x) MAKEWORD(HIBYTE(x), LOBYTE(x))
#define SWAPLONG(x) MAKELONG(SWAPWORD(HIWORD(x)), SWAPWORD(LOWORD(x)))
std::string GetFontNameFromFile(const char * FontFilePath)
{
CFile f;
if (!f.Open(FontFilePath, CFile::modeRead | CFile::shareDenyWrite))
{
return std::string("");
}
TT_OFFSET_TABLE ttOffsetTable;
f.Read(&ttOffsetTable, sizeof(TT_OFFSET_TABLE));
ttOffsetTable.uNumOfTables = SWAPWORD(ttOffsetTable.uNumOfTables);
ttOffsetTable.uMajorVersion = SWAPWORD(ttOffsetTable.uMajorVersion);
ttOffsetTable.uMinorVersion = SWAPWORD(ttOffsetTable.uMinorVersion);
//check is this is a true type font and the version is 1.0
if (ttOffsetTable.uMajorVersion != 1 || ttOffsetTable.uMinorVersion != 0)
{
return std::string("");
}
TT_TABLE_DIRECTORY tblDir;
bool bFound = false;
for (int i = 0; i< ttOffsetTable.uNumOfTables; i++)
{
f.Read(&tblDir, sizeof(TT_TABLE_DIRECTORY));
if (_strnicmp(tblDir.szTag, "name", 4) == 0)
{
bFound = true;
tblDir.uLength = SWAPLONG(tblDir.uLength);
tblDir.uOffset = SWAPLONG(tblDir.uOffset);
break;
}
}
std::string res;
if (bFound)
{
f.Seek(tblDir.uOffset, CFile::begin);
TT_NAME_TABLE_HEADER ttNTHeader;
f.Read(&ttNTHeader, sizeof(TT_NAME_TABLE_HEADER));
ttNTHeader.uNRCount = SWAPWORD(ttNTHeader.uNRCount);
ttNTHeader.uStorageOffset = SWAPWORD(ttNTHeader.uStorageOffset);
TT_NAME_RECORD ttRecord;
bFound = false;
for (int i = 0; i<ttNTHeader.uNRCount; i++)
{
f.Read(&ttRecord, sizeof(TT_NAME_RECORD));
ttRecord.uNameID = SWAPWORD(ttRecord.uNameID);
if (ttRecord.uNameID == 1)
{
ttRecord.uStringLength = SWAPWORD(ttRecord.uStringLength);
ttRecord.uStringOffset = SWAPWORD(ttRecord.uStringOffset);
int nPos = f.GetPosition();
f.Seek(tblDir.uOffset + ttRecord.uStringOffset + ttNTHeader.uStorageOffset, CFile::begin);
std::vector<char> NameBuf;
NameBuf.resize(ttRecord.uStringLength + 1);
memset(NameBuf.data(), 0, ttRecord.uStringLength + 1);
f.Read(NameBuf.data(), ttRecord.uStringLength);
if (NameBuf[0] != '\0')
{
res = NameBuf.data();
break;
}
f.Seek(nPos, CFile::begin);
}
}
}
f.Close();
return res;
}
std::string GetFontFolder()
{
char szFontPath[MAX_PATH];
if (SUCCEEDED(SHGetFolderPathA(NULL, CSIDL_FONTS, NULL, 0, szFontPath)))
{
return szFontPath;
}
return "";
}
FontList GetFontFiles()
{
std::string FontFolder = GetFontFolder();
FontList fonts;
if (FontFolder.length() > 0)
{
std::string SearchQuery = FontFolder;
SearchQuery += "\\*.ttf";
WIN32_FIND_DATAA FindData;
HANDLE hFind = FindFirstFileA(SearchQuery.c_str(), &FindData);
if (hFind != INVALID_HANDLE_VALUE)
{
do
{
std::string FontFile = FontFolder;
FontFile += "\\";
FontFile += FindData.cFileName;
std::string FontName = GetFontNameFromFile(FontFile.c_str());
if (FontName.length() > 0)
{
fonts.insert(FontList::value_type(FindData.cFileName, FontName));
}
} while (FindNextFileA(hFind, &FindData));
FindClose(hFind);
}
}
if (fonts.size() == 0)
{
fonts.insert(FontList::value_type("arial.ttf", "Arial"));
}
return fonts;
}

View File

@ -1,10 +0,0 @@
#pragma once
#include <string>
#include <map>
typedef std::map<std::string, std::string> FontList;
FontList GetFontFiles();
std::string GetFontFolder();
std::string GetFontNameFromFile(const char * FontFilePath);

View File

@ -1,10 +0,0 @@
#pragma once
#include <vector>
#include <string>
typedef std::vector<std::string> StringList;
void fillFullscreenResolutionsList(StringList & _listResolutions, int & _resolutionIdx, StringList & _listRefreshRates, int & _rateIdx);
void fillFullscreenRefreshRateList(int _resolutionIdx, StringList & _listRefreshRates, int & _rateIdx);
void getFullscreenResolutions(int _idx, unsigned int & _width, unsigned int & _height);
void getFullscreenRefreshRate(int _idx, unsigned int & _rate);

View File

@ -1,96 +0,0 @@
#include "About.h"
#include <thread>
#include "GLideNUI.h"
#include "Settings.h"
#include "../Config.h"
#include "ConfigDlg.h"
#ifdef QT_STATICPLUGIN
#include <QtPlugin>
Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin)
Q_IMPORT_PLUGIN(QICOPlugin)
#endif
//#define RUN_DIALOG_IN_THREAD
static
int openConfigDialog(const wchar_t * _strFileName, const char * _romName, unsigned int _maxMSAALevel, unsigned int _maxAnisotropy, bool & _accepted)
{
std::string IniFolder;
uint32_t slength = WideCharToMultiByte(CP_ACP, 0, _strFileName, -1, NULL, 0, NULL, NULL);
IniFolder.resize(slength);
slength = WideCharToMultiByte(CP_ACP, 0, _strFileName, -1, (LPSTR)IniFolder.c_str(), slength, NULL, NULL);
IniFolder.resize(slength - 1); //Remove null end char
loadSettings(IniFolder.c_str());
if (config.generalEmulation.enableCustomSettings != 0 && _romName != nullptr && strlen(_romName) != 0)
loadCustomRomSettings(IniFolder.c_str(), _romName);
LoadCurrentStrings(IniFolder.c_str(), config.translationFile);
CConfigDlg Dlg;
Dlg.setIniPath(IniFolder.c_str());
Dlg.setRomName(_romName);
Dlg.setMSAALevel(_maxMSAALevel);
Dlg.setMaxAnisotropy(_maxAnisotropy);
Dlg.DoModal();
_accepted = Dlg.Saved();
return 0;
}
bool runConfigThread(const wchar_t * _strFileName, const char * _romName, unsigned int _maxMSAALevel, unsigned int _maxAnisotropy)
{
bool accepted = false;
#ifdef RUN_DIALOG_IN_THREAD
std::thread configThread(openConfigDialog, _strFileName, _maxMSAALevel, std::ref(accepted));
configThread.join();
#else
openConfigDialog(_strFileName, _romName, _maxMSAALevel, _maxAnisotropy, accepted);
#endif
return accepted;
}
EXPORT bool CALL RunConfig(const wchar_t * _strFileName, const char * _romName, unsigned int _maxMSAALevel, unsigned int _maxAnisotropy)
{
return runConfigThread(_strFileName, _romName, _maxMSAALevel, _maxAnisotropy);
}
EXPORT int CALL RunAbout(const wchar_t * _strFileName)
{
std::string IniFolder;
uint32_t slength = WideCharToMultiByte(CP_ACP, 0, _strFileName, -1, NULL, 0, NULL, NULL);
IniFolder.resize(slength);
slength = WideCharToMultiByte(CP_ACP, 0, _strFileName, -1, (LPSTR)IniFolder.c_str(), slength, NULL, NULL);
IniFolder.resize(slength - 1); //Remove null end char
LoadCurrentStrings(IniFolder.c_str(), config.translationFile);
CAboutDlg Dlg;
Dlg.DoModal();
return 0;
}
EXPORT void CALL LoadConfig(const wchar_t * _strFileName)
{
std::string IniFolder;
uint32_t slength = WideCharToMultiByte(CP_ACP, 0, _strFileName, -1, NULL, 0, NULL, NULL);
IniFolder.resize(slength);
slength = WideCharToMultiByte(CP_ACP, 0, _strFileName, -1, (LPSTR)IniFolder.c_str(), slength, NULL, NULL);
IniFolder.resize(slength - 1); //Remove null end char
loadSettings(IniFolder.c_str());
}
EXPORT void CALL LoadCustomRomSettings(const wchar_t * _strFileName, const char * _romName)
{
std::string IniFolder;
uint32_t slength = WideCharToMultiByte(CP_ACP, 0, _strFileName, -1, NULL, 0, NULL, NULL);
IniFolder.resize(slength);
slength = WideCharToMultiByte(CP_ACP, 0, _strFileName, -1, (LPSTR)IniFolder.c_str(), slength, NULL, NULL);
IniFolder.resize(slength - 1); //Remove null end char
loadCustomRomSettings(IniFolder.c_str(), _romName);
}

View File

@ -1,25 +0,0 @@
#ifndef GLIDENUII_H
#define GLIDENUII_H
#if defined(__cplusplus)
extern "C" {
#endif
#ifdef _WIN32
#define EXPORT __declspec(dllexport)
#define CALL __cdecl
#else
#define EXPORT __attribute__((visibility("default")))
#define CALL
#endif
EXPORT bool CALL RunConfig(const wchar_t * _strFileName, const char * _romName, unsigned int _maxMSAALevel, unsigned int _maxAnisotropy);
EXPORT int CALL RunAbout(const wchar_t * _strFileName);
EXPORT void CALL LoadConfig(const wchar_t * _strFileName);
EXPORT void CALL LoadCustomRomSettings(const wchar_t * _strFileName, const char * _romName);
#if defined(__cplusplus)
}
#endif
#endif // GLIDENUII_H

Binary file not shown.

View File

@ -1,46 +0,0 @@
#include "InputDialog.h"
CInputDialog::CInputDialog(wchar_t * DlgTitle, wchar_t * Message, bool & ok) :
m_DlgTitle(DlgTitle != NULL ? DlgTitle : L""),
m_Message(Message != NULL ? Message : L""),
m_ok(ok)
{
m_ok = false;
}
std::wstring CInputDialog::getText(wchar_t * DlgTitle, wchar_t * Message, bool & ok)
{
CInputDialog Dlg(DlgTitle, Message, ok);
Dlg.DoModal();
return Dlg.GetInput();
}
LRESULT CInputDialog::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
HICON hIcon = AtlLoadIconImage(IDI_APPICON, LR_DEFAULTCOLOR, ::GetSystemMetrics(SM_CXICON), ::GetSystemMetrics(SM_CYICON));
SetIcon(hIcon, TRUE);
HICON hIconSmall = AtlLoadIconImage(IDI_APPICON, LR_DEFAULTCOLOR, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON));
SetIcon(hIconSmall, FALSE);
SetWindowText(m_DlgTitle.c_str());
GetDlgItem(IDC_INFO).SetWindowText(m_Message.c_str());
GetDlgItem(IDC_INPUT).SetFocus();
return 0;
}
LRESULT CInputDialog::OnOk(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
CWindow InputWnd = GetDlgItem(IDC_INPUT);
m_Input.resize(InputWnd.GetWindowTextLength() + 1);
InputWnd.GetWindowText((wchar_t *)m_Input.data(), m_Input.size());
m_ok = true;
EndDialog(wID);
return 0;
}
LRESULT CInputDialog::OnCancel(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
EndDialog(wID);
return 0;
}

View File

@ -1,34 +0,0 @@
#pragma once
#include <string>
#include "wtl.h"
#include "resource.h"
class CInputDialog :
public CDialogImpl<CInputDialog>
{
public:
static std::wstring getText(wchar_t * DlgTitle, wchar_t * Message, bool & ok);
CInputDialog(wchar_t * DlgTitle, wchar_t * Message, bool & ok);
enum { IDD = IDD_INPUT_DIALOG };
BEGIN_MSG_MAP_EX(CInputDialog)
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
COMMAND_ID_HANDLER(IDOK, OnOk)
COMMAND_ID_HANDLER(IDCANCEL, OnCancel)
END_MSG_MAP()
const std::wstring & GetInput() const { return m_Input; }
protected:
LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
LRESULT OnOk(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
LRESULT OnCancel(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
private:
CInputDialog(void);
std::wstring m_DlgTitle, m_Message, m_Input;
bool & m_ok;
};

View File

@ -1,414 +0,0 @@
#include "Language.h"
#include <windows.h>
#include <algorithm>
#include <map>
#include "../Config.h"
bool g_debugLang = false;
LANG_STRINGS g_currentStrings, g_defaultStrings;
void LoadDefaultStrings(void)
{
//Config Dialog
g_defaultStrings.insert(LANG_STRINGS::value_type(TAB_VIDEO, "Video"));
g_defaultStrings.insert(LANG_STRINGS::value_type(TAB_EMULATION, "Emulation"));
g_defaultStrings.insert(LANG_STRINGS::value_type(TAB_FRAME_BUFFER, "Frame buffer"));
g_defaultStrings.insert(LANG_STRINGS::value_type(TAB_TEXTURE_ENHANCEMENT, "Texture enhancement"));
g_defaultStrings.insert(LANG_STRINGS::value_type(TAB_OSD, "OSD"));
g_defaultStrings.insert(LANG_STRINGS::value_type(TAB_DEBUG, "Debug"));
g_defaultStrings.insert(LANG_STRINGS::value_type(CFG_SAVE_SETTINGS_FOR, "Save settings for:"));
g_defaultStrings.insert(LANG_STRINGS::value_type(CFG_SETTINGS_PROFILE, "Settings profile:"));
g_defaultStrings.insert(LANG_STRINGS::value_type(CFG_REMOVE, "Remove"));
g_defaultStrings.insert(LANG_STRINGS::value_type(CFG_RESTORE_DEFAULTS, "Restore Defaults"));
g_defaultStrings.insert(LANG_STRINGS::value_type(CFG_SAVE_AND_CLOSE, "Save and Close"));
g_defaultStrings.insert(LANG_STRINGS::value_type(CFG_SAVE, "Save"));
g_defaultStrings.insert(LANG_STRINGS::value_type(CFG_CLOSE, "Close"));
//Video Tab
g_defaultStrings.insert(LANG_STRINGS::value_type(VIDEO_GROUP, "Video"));
g_defaultStrings.insert(LANG_STRINGS::value_type(VIDEO_FULL_SCREEN_RES, "Full screen resolution:"));
g_defaultStrings.insert(LANG_STRINGS::value_type(VIDEO_FULL_SCREEN_RES_TOOLTIP, "All the resolutions that your video card/monitor supports should be displayed.\n\n[Recommended: Maximum resolution for your monitor unless performance becomes an issue]"));
g_defaultStrings.insert(LANG_STRINGS::value_type(VIDEO_REFRESH_RATE, "Refresh rate:"));
g_defaultStrings.insert(LANG_STRINGS::value_type(VIDEO_REFRESH_RATE_TOOLTIP, ""));
g_defaultStrings.insert(LANG_STRINGS::value_type(VIDEO_WINDOWED_RESOLUTION, "Windowed resolution:"));
g_defaultStrings.insert(LANG_STRINGS::value_type(VIDEO_WINDOWED_RESOLUTION_TOOLTIP, "This option selects the resolution for windowed mode. You can also type in a custom window size.\n\n[Recommended: 640 x 480, 800 x 600, 1024 x 768, 1280 x 960]"));
g_defaultStrings.insert(LANG_STRINGS::value_type(VIDEO_ASPECT_RATIO, "Aspect ratio:"));
g_defaultStrings.insert(LANG_STRINGS::value_type(VIDEO_ASPECT_RATIO_TOOLTIP, "This setting adjusts the aspect ratio of the video output. All N64 games support 4:3. Some games support 16:9 within game settings. Use Stretch to fill the screen without pillar or letterboxing.\n\nTry to adjust game to fit tries to adjust the viewing space to fit without stretching. Many games work well adjusted, but some don't."));
g_defaultStrings.insert(LANG_STRINGS::value_type(VIDEO_ASPECT_4_3, "4:3 (recommended)"));
g_defaultStrings.insert(LANG_STRINGS::value_type(VIDEO_ASPECT_16_19, "16:9"));
g_defaultStrings.insert(LANG_STRINGS::value_type(VIDEO_ASPECT_STRETCH, "Stretch"));
g_defaultStrings.insert(LANG_STRINGS::value_type(VIDEO_ASPECT_ADJUST, "Try to adjust game to fit"));
g_defaultStrings.insert(LANG_STRINGS::value_type(VIDEO_VSYNC, "Enable VSync"));
g_defaultStrings.insert(LANG_STRINGS::value_type(VIDEO_VSYNC_TOOLTIP, "Vertical sync, or VSync, can improve the image by syncing the game's frame rate to your monitor's refresh rate. This prevents image tearing, but may cause performance problems.\n\n[Recommended: Usually off, on if you have image tearing problems]"));
g_defaultStrings.insert(LANG_STRINGS::value_type(VIDEO_THREADED_VIDEO, "Enable threaded video"));
g_defaultStrings.insert(LANG_STRINGS::value_type(VIDEO_THREADED_VIDEO_TOOLTIP, "Threaded video can improve performance with poor OpenGL drivers at the cost of very marginal input lag, usually less than half a frame.\n\n[Recommended: Usually off, unless there are performance issues]"));
g_defaultStrings.insert(LANG_STRINGS::value_type(VIDEO_OVERSCAN, "Overscan"));
g_defaultStrings.insert(LANG_STRINGS::value_type(VIDEO_OVERSCAN_TOOLTIP, "When enabled, the image is cropped by values specified in N64 pixels. Useful to remove black borders in some games."));
g_defaultStrings.insert(LANG_STRINGS::value_type(VIDEO_NTSC, "NTSC"));
g_defaultStrings.insert(LANG_STRINGS::value_type(VIDEO_PAL, "PAL"));
g_defaultStrings.insert(LANG_STRINGS::value_type(VIDEO_ANTI_ALIASING, "Anti-aliasing"));
g_defaultStrings.insert(LANG_STRINGS::value_type(VIDEO_NO_ANTI_ALIASING, "No anti-aliasing"));
g_defaultStrings.insert(LANG_STRINGS::value_type(VIDEO_FAST_ANTI_ALIASING, "Fast approximate anti-aliasing (FXAA)"));
g_defaultStrings.insert(LANG_STRINGS::value_type(VIDEO_MULTISAMPLE_ANTI_ALIASING, "Multisample anti-aliasing (MSAA):"));
g_defaultStrings.insert(LANG_STRINGS::value_type(VIDEO_AA_OFF, "Off"));
g_defaultStrings.insert(LANG_STRINGS::value_type(VIDEO_AA_HIGH, "High"));
g_defaultStrings.insert(LANG_STRINGS::value_type(VIDEO_AA_TOOLTIP, "GLideN64 offers two methods to smooth jagged polygons:\n\nFast approximate anti-aliasing (FXAA): FXAA is a post-processing filter that can provide a decent result, but as good as MSAA. The main reason to use FXAA is to use with N64-style depth compare. FXAA adds some blurriness to the output image, causing some textures like text to possibly look worse.\n\nMultisample anti-aliasing (MSAA): MSAA is a standard anti-aliasing technique used in computer graphics to improve image quality. Most modern GPUs support 2, 4, 8, and 16 samples. More samples mean better quality, but are slower. There are two downsides: it's incompatible with N64-style depth compare and may cause minor glitches in some games.\n\nRecommendation: [Usually 16x MSAA, or FXAA with N64-style depth compare]"));
g_defaultStrings.insert(LANG_STRINGS::value_type(VIDEO_AA_INFO, "Multisample anti-aliasing is not compatible with N64-style depth compare."));
g_defaultStrings.insert(LANG_STRINGS::value_type(VIDEO_FILTERING_GROUP, "Filtering"));
g_defaultStrings.insert(LANG_STRINGS::value_type(VIDEO_ANISOTROPIC, "Anisotropic filtering:"));
g_defaultStrings.insert(LANG_STRINGS::value_type(VIDEO_ANISOTROPIC_OFF, "Off"));
g_defaultStrings.insert(LANG_STRINGS::value_type(VIDEO_ANISOTROPIC_HIGH, "High"));
g_defaultStrings.insert(LANG_STRINGS::value_type(VIDEO_BILINEAR, "Bilinear filtering:"));
g_defaultStrings.insert(LANG_STRINGS::value_type(VIDEO_BILINEAR_STANDARD, "Standard"));
g_defaultStrings.insert(LANG_STRINGS::value_type(VIDEO_BILINEAR_3POINT, "N64-style 3 point"));
g_defaultStrings.insert(LANG_STRINGS::value_type(VIDEO_BILINEAR_TOOLTIP, "Bilinear filtering: Textures will use standard PC-style bilinear filtering.\n\nN64-style 3 point: Textures will be filtered more like the N64. The result is less smooth but more accurate."));
g_defaultStrings.insert(LANG_STRINGS::value_type(VIDEO_DITHERING_GROUP, "Dithering"));
g_defaultStrings.insert(LANG_STRINGS::value_type(VIDEO_PATTERN, "Pattern (RDRAM):"));
g_defaultStrings.insert(LANG_STRINGS::value_type(VIDEO_DITHERING_APPLY_TO_OUTPUT, "Apply to final output"));
g_defaultStrings.insert(LANG_STRINGS::value_type(VIDEO_DITHERING_APPLY_TO_OUTPUT_TOOLTIP, "This setting enables game controlled ordered grid dithering. Enable it for accurate representation. Default = disabled."));
g_defaultStrings.insert(LANG_STRINGS::value_type(VIDEO_DITHERING_5BIT_QUANTIZATION, "Enable 5-bit quantization"));
g_defaultStrings.insert(LANG_STRINGS::value_type(VIDEO_DITHERING_5BIT_QUANTIZATION_TOOLTIP, "Like real hardware this setting reduces the number of colors if dithering is used. Removes undesired dithering fragments. Default = enabled."));
g_defaultStrings.insert(LANG_STRINGS::value_type(VIDEO_DITHERING_HIRES_NOISE, "High resolution noise"));
g_defaultStrings.insert(LANG_STRINGS::value_type(VIDEO_DITHERING_HIRES_NOISE_TOOLTIP, "This setting doubles noise resolution to get a finer noise effect at higher resolutions. Default = disabled."));
g_defaultStrings.insert(LANG_STRINGS::value_type(VIDEO_DITHERING_MODE_TOOLTIP, "RDRAM dithering prevents color banding in games with framebuffer effects.\nSettings: Disabled, Bayer ordered grid dithering, Magic Square ordered grid dithering or blue noise dithering. Blue noise dithering produces unobtrusive results. Default = blue noise dithering."));
g_defaultStrings.insert(LANG_STRINGS::value_type(VIDEO_DITHERING_DISABLE, "disable"));
g_defaultStrings.insert(LANG_STRINGS::value_type(VIDEO_DITHERING_BAYER, "Bayer"));
g_defaultStrings.insert(LANG_STRINGS::value_type(VIDEO_DITHERING_MAGIC_SQUARE, "Magic square"));
g_defaultStrings.insert(LANG_STRINGS::value_type(VIDEO_DITHERING_BLUE_NOISE, "Blue noise"));
g_defaultStrings.insert(LANG_STRINGS::value_type(VIDEO_LANGUAGE, "Language:"));
//Emulation Tab
g_defaultStrings.insert(LANG_STRINGS::value_type(EMULATION_USE_PER_GAME, "Use per-game settings"));
g_defaultStrings.insert(LANG_STRINGS::value_type(EMULATION_USE_PER_GAME_TOOLTIP, "When enabled, all non-default values of settings are stored individually for each game.\n\nWhen a game is running, settings are displayed and saved for the currently running game.\n\nNote: GLideN64 already contains settings for the optimal performance of most games. Be careful when altering options on 'Emulation' and 'Frame buffer' tab.\n\n[Recommended: Checked]"));
g_defaultStrings.insert(LANG_STRINGS::value_type(EMULATION_N64_STYLE_MIP_MAPPING, "Enable N64-style mip-mapping"));
g_defaultStrings.insert(LANG_STRINGS::value_type(EMULATION_N64_STYLE_MIP_MAPPING_TOOLTIP, "The N64 uses a unique method of mip-mapping that's difficult to reproduce correctly on PCs. When checked, this option emulates N64-accurate mip-mapping. When unchecked, some games have sharper distant textures.\n\n[Recommended: Checked]"));
g_defaultStrings.insert(LANG_STRINGS::value_type(EMULATION_HWLIGHTING, "Enable per-pixel lighting (better quality, HLE only)"));
g_defaultStrings.insert(LANG_STRINGS::value_type(EMULATION_HWLIGHTING_TOOLTIP, "In N64 games lighting is calculated per vertex. This option enables Phong shading, which provides smoother and more realistic lighting.\n\n[Recommended: Your preference]"));
g_defaultStrings.insert(LANG_STRINGS::value_type(EMULATION_PIXEL_COVERAGE, "Enable pixel coverage calculation"));
g_defaultStrings.insert(LANG_STRINGS::value_type(EMULATION_PIXEL_COVERAGE_TOOLTIP, "Enables approximated pixel coverage calculation. N64 uses pixel coverage for anti-aliasing and in some special blending modes. Some games have wire-frame mode aka 'pen and ink' mode. This mode also needs pixel coverage calculated.\n\n[Recommended: Checked, unless performance is hurt]"));
g_defaultStrings.insert(LANG_STRINGS::value_type(EMULATION_SHADERS_STORAGE, "Store compiled shaders for performance (recommended)"));
g_defaultStrings.insert(LANG_STRINGS::value_type(EMULATION_SHADERS_STORAGE_TOOLTIP, "Use persistent storage for compiled shader programs.\nEach game uses a set of combiners. A combiner is an equation that defines how to build output color from various color inputs. GLideN64 translates shaders, and compiles shader programs on the fly. Shaders are large and complex. If the game uses several new combiners, compiling new shaders will take time and result in stuttering. When this option is checked, these shaders are saved so they're not recompiled the next time you run the game.\n\n[Recommended: Checked]"));
g_defaultStrings.insert(LANG_STRINGS::value_type(EMULATION_INTERNAL_RES, "Internal resolution"));
g_defaultStrings.insert(LANG_STRINGS::value_type(EMULATION_INTERNAL_RES_TOOLTIP, "This option sets the output render buffer size. By default, the render buffer is set to the Same as output resolution, but you can set it to the Original N64 resolution or a Multiple of N64 resolution."));
g_defaultStrings.insert(LANG_STRINGS::value_type(EMULATION_FACTOR0X, "Same as output resolution"));
g_defaultStrings.insert(LANG_STRINGS::value_type(EMULATION_FACTOR1X, "Original N64 resolution (most accurate)"));
g_defaultStrings.insert(LANG_STRINGS::value_type(EMULATION_FACTORXX, "Multiple of N64 resolution:"));
g_defaultStrings.insert(LANG_STRINGS::value_type(EMULATION_GAMMA, "Gamma"));
g_defaultStrings.insert(LANG_STRINGS::value_type(EMULATION_GAMMA_TOOLTIP, "Some N64 games use gamma correction to brighten the image. When the frame buffer is enabled, gamma correction is applied automatically for all games that use it on the N64. You can use your own gamma correction instead with this option. The default level, used on the N64, is 2.\n\n[Recommended: Unchecked; 2.00]"));
g_defaultStrings.insert(LANG_STRINGS::value_type(EMULATION_GAMMA_CORRECTION, "Custom gamma correction level:"));
g_defaultStrings.insert(LANG_STRINGS::value_type(EMULATION_GAMMA_INFO, "Selecting this option overrides gamma correction specified by the game."));
g_defaultStrings.insert(LANG_STRINGS::value_type(EMULATION_2D_ELEMENTS, "2D elements"));
g_defaultStrings.insert(LANG_STRINGS::value_type(EMULATION_RENDER_2D_ELEMENTS, "Render 2D elements in N64 resolution (best quality, can be slow):"));
g_defaultStrings.insert(LANG_STRINGS::value_type(EMULATION_RENDER_2D_TOOLTIP, "When checked, 2D elements are rendered at the N64s resolution before copying them to output. This usually eliminates display issues with 2D elements, but it can be slow. This option uses heuristics to detect adjacent 2D elements that doesn't work for every game.\n\n[Recommended: Checked, unless you have performance problems]"));
g_defaultStrings.insert(LANG_STRINGS::value_type(EMULATION_RENDER_DISABLE, "Disable"));
g_defaultStrings.insert(LANG_STRINGS::value_type(EMULATION_RENDER_ENABLE_OPTIMIZED, "Enable optimized"));
g_defaultStrings.insert(LANG_STRINGS::value_type(EMULATION_RENDER_ENABLE_UNOPTIMIZED, "Enable unoptimized"));
g_defaultStrings.insert(LANG_STRINGS::value_type(EMULATION_HALOS_REMOVAL, "Try to remove colored halos around transparent objects"));
g_defaultStrings.insert(LANG_STRINGS::value_type(EMULATION_FIX_BLACK_LINES, "Fix black lines between 2D elements:"));
g_defaultStrings.insert(LANG_STRINGS::value_type(EMULATION_FIX_BLACK_LINES_TOOLTIP, "In some games the coordinates for parts of 2D elements are not aligned: there is a half-pixel split between adjacent elements. When rendering at the N64's original resolution it isn't visible, but when the image is scaled up it results in black lines. This option attempts to connect these 2D elements.\n\nFor adjacent 2D elements: Apply the correction only for polygons that need it. Select this option for games that have issues with black lines.\n\nAlways: Apply the correction for every 2D element. Select this option when For adjacent 2D elements doesn't help.\n\nNever: Don't attempt to correct black lines between 2D elements.\n\n[Recommended: Game dependent, mostly Never]"));
g_defaultStrings.insert(LANG_STRINGS::value_type(EMULATION_ADJACENT_2D_ELEMENTS, "For adjacent 2D elements"));
g_defaultStrings.insert(LANG_STRINGS::value_type(EMULATION_ALWAYS, "Always"));
g_defaultStrings.insert(LANG_STRINGS::value_type(EMULATION_NEVER, "Never"));
g_defaultStrings.insert(LANG_STRINGS::value_type(EMULATION_BACKGROUND, "Background rendering mode (HLE only):"));
g_defaultStrings.insert(LANG_STRINGS::value_type(EMULATION_BACKGROUND_TOOLTIP, "Background is a complex macro command used to render large (normally full screen) images. Since background images usually don't fit texture memory, the microcode splits them on narrow strips and renders them one by one. HLE code has two modes to emulate background commands:\n\nOne piece: The whole background image rendred as one textured rectangle. This method is normally much faster, but the result is not always correct.\n\nStripped: This method emulates background commands as close as possible to actual microcode implementation. It's slower but more precise. Another problem: some games may have gaps between rendered strips in high resolution. Use \"Render 2D elements in N64 resolution\" option to remove the gaps.\n\n[Recommended: Game dependent, mostly Stripped]"));
g_defaultStrings.insert(LANG_STRINGS::value_type(EMULATION_ONE_PIECE, "One piece"));
g_defaultStrings.insert(LANG_STRINGS::value_type(EMULATION_STRIPPED, "Stripped"));
//Frame Buffer Tab
g_defaultStrings.insert(LANG_STRINGS::value_type(FRAMEBUFFER_ENABLE, "Emulate frame buffer"));
g_defaultStrings.insert(LANG_STRINGS::value_type(FRAMEBUFFER_ENABLE_INFO, "Unchecking this option disables many effects including cropping, aspect ratio, N64 resolution factor, N64-style depth compare and more. Don't uncheck this option unless you have performance issues."));
g_defaultStrings.insert(LANG_STRINGS::value_type(FRAMEBUFFER_COPY_AUX_BUFFERS, "Copy auxiliary color buffers to N64 memory (sometimes slow, fewer game issues)"));
g_defaultStrings.insert(LANG_STRINGS::value_type(FRAMEBUFFER_COPY_AUX_BUFFERS_TOOLTIP, "When checked, the auxiliary color buffer is copied to N64 memory right after rendering to it is finished. This option helps to correctly emulate frame buffer effects in some games. This option may noticeably reduce performance.\n\n[Recommended: Usually unchecked]"));
g_defaultStrings.insert(LANG_STRINGS::value_type(FRAMEBUFFER_SWAP, "Frame buffer swap on:"));
g_defaultStrings.insert(LANG_STRINGS::value_type(FRAMEBUFFER_SWAP_TOOLTIP, "This option controls how often GLideN64 updates the main frame buffer.\n\nVertical interrupt: Update the buffer as quickly as possible, every vertical interrupt per second (50 for PAL and 60 for NTSC games). This option is the most compatible. Use this mode unless you have performance problems.\n\nVI origin change: The VI origin changes corresponding to the game's actual FPS. N64 games typically run between 20 to 30 FPS so the buffers swap less often than the first mode. This mode does not work for games that use single buffering, which is rare.\n\nColor buffer change: This option checks to see if the frame buffer has been changed. There are some games where this doesn't work."));
g_defaultStrings.insert(LANG_STRINGS::value_type(FRAMEBUFFER_VERTICAL_INTERRUPT, "Vertical interrupt (recommended, fewest game issues)"));
g_defaultStrings.insert(LANG_STRINGS::value_type(FRAMEBUFFER_VI_ORIGIN_CHANGE, "VI origin change (faster, few game issues)"));
g_defaultStrings.insert(LANG_STRINGS::value_type(FRAMEBUFFER_COLOR_BUFFER_CHANGE, "Color buffer change (fastest, some game issues)"));
g_defaultStrings.insert(LANG_STRINGS::value_type(FRAMEBUFFER_INFO_ENABLE, "Use emulator help to read/write frame buffers"));
g_defaultStrings.insert(LANG_STRINGS::value_type(FRAMEBUFFER_INFO_ENABLE_TOOLTIP, "Some emulators do a poor job of detecting when to read/write frame buffers. You can disable emulator help to let GLideN64 read/write frame buffers itself.\n\n[Recommended: Usually unchecked, but for some games/emulators it may be faster checked]"));
g_defaultStrings.insert(LANG_STRINGS::value_type(FRAMEBUFFER_READ_COLOR_CHUNK, "Read color buffer in 4 KB chunks"));
g_defaultStrings.insert(LANG_STRINGS::value_type(FRAMEBUFFER_READ_COLOR_CHUNK_TOOLTIP, "When checked, the color buffer will be read in chunks. Otherwise, the buffer will be read in its entirety. If a game needs to read the entire buffer, selecting this option may be slow.\n\n[Recommended: Usually unchecked, because the color buffer is usually read entirely]"));
g_defaultStrings.insert(LANG_STRINGS::value_type(FRAMEBUFFER_READ_DEPTH_CHUNK, "Read depth buffer in 4 KB chunks"));
g_defaultStrings.insert(LANG_STRINGS::value_type(FRAMEBUFFER_READ_DEPTH_CHUNK_TOOLTIP, "When checked, the depth buffer will be read in chunks. Otherwise the buffer will be read in its entirety. If a game needs to read the entire buffer, selecting this option may be slow.\n\n[Recommended: Checked, because the depth buffer is not often read entirely]"));
g_defaultStrings.insert(LANG_STRINGS::value_type(FRAMEBUFFER_COPY_COLOR_BUFFER, "Copy video card frame buffer to N64 memory:"));
g_defaultStrings.insert(LANG_STRINGS::value_type(FRAMEBUFFER_COPY_COLOR_BUFFER_TOOLTIP, "In some games GLideN64 can't detect when the game uses the frame buffer. With these options, you can have GLideN64 copy each frame of your video card's frame buffer to N64 memory.\n\nNever: Disable copying buffers from video card.\n\nSynchronous: Effects are detected for all games, but it can be slow. Use for games where Asynchronous doesn't work.\n\nAsynchronous: Effects are detected for most games.\n\n[Recommended: Usually Asynchronous]"));
g_defaultStrings.insert(LANG_STRINGS::value_type(FRAMEBUFFER_COPY_NEVER, "Never (fastest, many game issues)"));
g_defaultStrings.insert(LANG_STRINGS::value_type(FRAMEBUFFER_COPY_SYNCHRONOUS, "Synchronous (slowest, fewest game issues)"));
g_defaultStrings.insert(LANG_STRINGS::value_type(FRAMEBUFFER_COPY_ASYNCHRONOUS, "Asynchronous (fast, few game issues)"));
g_defaultStrings.insert(LANG_STRINGS::value_type(FRAMEBUFFER_COPY_DEPTH_BUFFER, "Copy video card depth buffer to N64 memory:"));
g_defaultStrings.insert(LANG_STRINGS::value_type(FRAMEBUFFER_COPY_DEPTH_BUFFER_TOOLTIP, "The depth buffer is used to emulate some effects (e.g. coronas):\n\nNever: Depth buffer is disabled.\n\nFrom VRAM: Your video card's depth buffer is copied to N64 memory each frame, which can be slow on some games.\n\nIn software: Generally faster than copying from VRAM, but the result can be imperfect.\n\n[Recommended: In software]"));
g_defaultStrings.insert(LANG_STRINGS::value_type(FRAMEBUFFER_COPY_DEPTH_NEVER, "Never (fastest, most game issues)"));
g_defaultStrings.insert(LANG_STRINGS::value_type(FRAMEBUFFER_COPY_DEPTH_VRAM, "From VRAM (slow, some game issues)"));
g_defaultStrings.insert(LANG_STRINGS::value_type(FRAMEBUFFER_COPY_DEPTH_SOFTWARE, "In software (fast, fewest game issues)"));
g_defaultStrings.insert(LANG_STRINGS::value_type(FRAMEBUFFER_N64_DEPTH_COMPARE, "N64-style depth compare (experimental, disables MSAA)"));
g_defaultStrings.insert(LANG_STRINGS::value_type(FRAMEBUFFER_N64_DEPTH_COMPARE_TOOLTIP, "The N64 uses a unique method of calculating depth to the camera. When enabled, GlideN64 uses shaders to try to emulate these calculations correctly. Not compatible with anti-aliasing. Experimental!\nFast mode requires OpenGL 4.2 and fragment shader interlock extensions.\nCompatible mode requires only core OpenGL 4.2 Can be slow!\n[Recommended: Sometimes checked, for several games]"));
g_defaultStrings.insert(LANG_STRINGS::value_type(FRAMEBUFFER_N64_DEPTH_DISABLE, "Disable"));
g_defaultStrings.insert(LANG_STRINGS::value_type(FRAMEBUFFER_N64_DEPTH_FAST, "Fast"));
g_defaultStrings.insert(LANG_STRINGS::value_type(FRAMEBUFFER_N64_DEPTH_COMPATIBLE, "Compatible"));
g_defaultStrings.insert(LANG_STRINGS::value_type(FRAMEBUFFER_FORCE_DEPTH_BUFFER_CLEAR, "Force depth buffer clear"));
g_defaultStrings.insert(LANG_STRINGS::value_type(FRAMEBUFFER_FORCE_DEPTH_BUFFER_CLEAR_TOOLTIP, "Enable force depth buffer clear. A hack. Necessary for Eikou no Saint Andrews.\n\n[Recommended: off, except for Eikou no Saint Andrews]"));
g_defaultStrings.insert(LANG_STRINGS::value_type(FRAMEBUFFER_RENDER_FRAMEBUFFER, "Render N64 frame buffer to output"));
g_defaultStrings.insert(LANG_STRINGS::value_type(FRAMEBUFFER_RENDER_FRAMEBUFFER_TOOLTIP, "When this option is checked, the frame buffer is rendered directly to the screen. This prevents some graphic problems but may cause slowdowns or visual quality problems.\n\n[Recommended: Usually unchecked]"));
g_defaultStrings.insert(LANG_STRINGS::value_type(FRAMEBUFFER_COPY_DEPTH_TO_MAIN, "Copy depth to main depth buffer"));
g_defaultStrings.insert(LANG_STRINGS::value_type(FRAMEBUFFER_COPY_DEPTH_TO_MAIN_TOOLTIP, "This option is required for some Reshade depth dependant effects, such as SSAO and depth of field.\n\n[Recommended: only if you use Reshade and need depth dependant effects]"));
//Texture enhancement
g_defaultStrings.insert(LANG_STRINGS::value_type(TEXTURE_N64_TEXTURES_GROUP, "N64 textures"));
g_defaultStrings.insert(LANG_STRINGS::value_type(TEXTURE_N64_FILTER, "Filter:"));
g_defaultStrings.insert(LANG_STRINGS::value_type(TEXTURE_N64_FILTER_TOOLTIP, "This filter smooths or sharpens textures. There are four smoothing filters and two sharpening filters. The higher the number, the stronger the effect. Performance may be affected depending on the game and/or your PC.\n\n[Recommended: Your preference]"));
g_defaultStrings.insert(LANG_STRINGS::value_type(TEXTURE_N64_FILTER_NONE, "None"));
g_defaultStrings.insert(LANG_STRINGS::value_type(TEXTURE_N64_FILTER_SMOOTH1, "Smooth filtering 1"));
g_defaultStrings.insert(LANG_STRINGS::value_type(TEXTURE_N64_FILTER_SMOOTH2, "Smooth filtering 2"));
g_defaultStrings.insert(LANG_STRINGS::value_type(TEXTURE_N64_FILTER_SMOOTH3, "Smooth filtering 3"));
g_defaultStrings.insert(LANG_STRINGS::value_type(TEXTURE_N64_FILTER_SMOOTH4, "Smooth filtering 4"));
g_defaultStrings.insert(LANG_STRINGS::value_type(TEXTURE_N64_FILTER_SHARP1, "Sharp filtering 1"));
g_defaultStrings.insert(LANG_STRINGS::value_type(TEXTURE_N64_FILTER_SHARP2, "Sharp filtering 2"));
g_defaultStrings.insert(LANG_STRINGS::value_type(TEXTURE_ENHANCEMENT, "Enhancement:"));
g_defaultStrings.insert(LANG_STRINGS::value_type(TEXTURE_ENHANCEMENT_TOOLTIP, "There are 12 distinct filters to select. Depending on which filter, they may cause performance problems.\n\nWhen Store is selected, textures are saved to the cache as-is. This improves performance in games that load many textures. Uncheck Disable for backgrounds for the best performance.\n\n[Recommended: Your preference]"));
g_defaultStrings.insert(LANG_STRINGS::value_type(TEXTURE_ENHANCEMENT_NONE, "None"));
g_defaultStrings.insert(LANG_STRINGS::value_type(TEXTURE_ENHANCEMENT_STORE, "Store"));
g_defaultStrings.insert(LANG_STRINGS::value_type(TEXTURE_DECREASE_COLOR, "Decrease color banding (recommended for xBRZ enhancement)"));
g_defaultStrings.insert(LANG_STRINGS::value_type(TEXTURE_DECREASE_COLOR_TOOLTIP, "This option enables a pre-processing step that reduces posterization issues on enhanced textures.\n\n[Recommended: Checked for xBRZ]"));
g_defaultStrings.insert(LANG_STRINGS::value_type(TEXTURE_IGNORE_BACKGROUNDS, "Disable for backgrounds"));
g_defaultStrings.insert(LANG_STRINGS::value_type(TEXTURE_IGNORE_BACKGROUNDS_TOOLTIP, "This option skips texture enhancements for long, narrow textures that are usually used for backgrounds. This may save texture memory and improve performance.\n\n[Recommended: Checked, unless Enhancement is set to Store]"));
g_defaultStrings.insert(LANG_STRINGS::value_type(TEXTURE_USE_FILE_STORAGE, "Use file storage instead of memory cache"));
g_defaultStrings.insert(LANG_STRINGS::value_type(TEXTURE_USE_TEXTURE_PACK, "Use texture pack"));
g_defaultStrings.insert(LANG_STRINGS::value_type(TEXTURE_TEXTURE_PACK, "Texture pack path:"));
g_defaultStrings.insert(LANG_STRINGS::value_type(TEXTURE_TEXTURE_PACK_TOOLTIP, "Select path to the folder with texture packs.\nDefault: Plugin/hires_texture"));
g_defaultStrings.insert(LANG_STRINGS::value_type(TEXTURE_CACHE_PATH, "Texture cache path:"));
g_defaultStrings.insert(LANG_STRINGS::value_type(TEXTURE_DUMP_PATH, "Texture dump path:"));
g_defaultStrings.insert(LANG_STRINGS::value_type(TEXTURE_USE_FULL_TRANSPARENCIES, "Use full transparencies (recommended for newer texture packs)"));
g_defaultStrings.insert(LANG_STRINGS::value_type(TEXTURE_USE_FULL_TRANSPARENCIES_TOOLTIP, "When this option is cleared, textures will be loaded as they are when using Rice Video: transparencies either on or off. When this option is selected, GlideN64 will check how the texture's alpha channel was designed and will select the most appropriate format. This gives texture pack designers freedom to use semi-transparent textures.\n\nClear this option for older or poorly designed texture packs.\n\n[Recommended: Texture pack dependent]"));
g_defaultStrings.insert(LANG_STRINGS::value_type(TEXTURE_ALTERNATIVE_CRC, "Alternative CRC calculation (for old Rice Video packs)"));
g_defaultStrings.insert(LANG_STRINGS::value_type(TEXTURE_ALTERNATIVE_CRC_TOOLTIP, "This option emulates a palette CRC calculation bug in Rice Video. If you have problems loading textures, try checking or unchecking this option.\n\n[Recommended: Mostly unchecked, checked for old texture packs]"));
g_defaultStrings.insert(LANG_STRINGS::value_type(TEXTURE_USE_FILE_STORAGE_TOOLTIP, "This option enables alternative storage for hi-res textures. Normally memory cache is used. It keeps all hi-res textures in RAM and thus limited by available RAM size. File storage keeps texture cache on HDD. It is slower than memory cache, but has virtually no limits on cache size. Disable \"Compress texture cache\" option for better performance."));
g_defaultStrings.insert(LANG_STRINGS::value_type(TEXTURE_SIZE_OF_MEMORY_CACHE, "Size of memory cache for enhanced textures:"));
g_defaultStrings.insert(LANG_STRINGS::value_type(TEXTURE_SIZE_OF_MEMORY_CACHE_TOOLTIP, "Enhanced and filtered textures can be cached to improve performance. This option adjusts how much memory is dedicated to the texture cache. This can improve performance if there are many requests for the same texture, which is usually the case. Normally 128 MB should be more than enough, but the best option is different for each game. Super Mario 64 may not need more than 32 MB, but Conker's Bad Fur Day can take advantage of 256 MB+. Adjust accordingly if you are having performance problems. Setting this option to 0 disables the cache.\n\n[Recommended: PC and game dependent]"));
g_defaultStrings.insert(LANG_STRINGS::value_type(TEXTURE_SAVE_ENHANCED, "Save enhanced texture cache to hard disk"));
g_defaultStrings.insert(LANG_STRINGS::value_type(TEXTURE_SAVE_ENHANCED_TOOLTIP, "This option saves all previously loaded and enhanced textures to your PC. When the game is next launched, textures don't have to be recreated, causing smoother performance.\n\nWhen using texture packs, loading packs will take only a few seconds when the game is launched as opposed to the 5-60 seconds that loading usually takes. However, if you change the texture pack you'll have to manually delete the texture cache. Saved cache files are saved to a folder called Cache within the plugins folder.\n\n[Recommended: Checked]"));
g_defaultStrings.insert(LANG_STRINGS::value_type(TEXTURE_COMPRESS_CACHE, "Compress texture cache"));
g_defaultStrings.insert(LANG_STRINGS::value_type(TEXTURE_COMPRESS_CACHE_TOOLTIP, "Textures will be compressed so more textures can be held in the cache. The compression ratio varies per texture, but the compression is typically 1/5 of the original size.\n\n[Recommended: Checked]"));
g_defaultStrings.insert(LANG_STRINGS::value_type(TEXTURE_CONVERT_16BPP, "Convert textures to 16 bpp"));
g_defaultStrings.insert(LANG_STRINGS::value_type(TEXTURE_CONVERT_16BPP_TOOLTIP, "This option halves the space used by textures in the texture cache and video card memory to improve performance. When reducing the color, GLideN64 tries to perserve the original quality as much as possible. On most textures it's hardly noticeable, but some textures, like skies, can look noticeably worse.\n\n[Recommended: Unchecked]"));
//On-screen display
g_defaultStrings.insert(LANG_STRINGS::value_type(OSD_POSITION, "Position"));
g_defaultStrings.insert(LANG_STRINGS::value_type(OSD_DISPLAY_FPS, "Display FPS"));
g_defaultStrings.insert(LANG_STRINGS::value_type(OSD_DISPLAY_VI, "Display VI/s"));
g_defaultStrings.insert(LANG_STRINGS::value_type(OSD_DISPLAY_PERCENTAGE, "Display percentage"));
g_defaultStrings.insert(LANG_STRINGS::value_type(OSD_DISPLAY_INTERNAL_RESOLUTION, "Display internal resolution"));
g_defaultStrings.insert(LANG_STRINGS::value_type(OSD_DISPLAY_RENDERING_RESOLUTION, "Display rendering resolution"));
g_defaultStrings.insert(LANG_STRINGS::value_type(OSD_FONT, "Font"));
g_defaultStrings.insert(LANG_STRINGS::value_type(OSD_SIZE, "Size:"));
g_defaultStrings.insert(LANG_STRINGS::value_type(OSD_PX, "px"));
g_defaultStrings.insert(LANG_STRINGS::value_type(OSD_COLOR, "Color:"));
g_defaultStrings.insert(LANG_STRINGS::value_type(OSD_PREVIEW, "Preview"));
//Debug tab
g_defaultStrings.insert(LANG_STRINGS::value_type(DEBUG_DUMP_LOWLEVEL_INFO, "Dump low-level info"));
g_defaultStrings.insert(LANG_STRINGS::value_type(DEBUG_DUMP_DISPLAY_LIST, "Dump display list commands"));
g_defaultStrings.insert(LANG_STRINGS::value_type(DEBUG_DUMP_DETAILED_INFO, "Dump detailed info (matrices, vertices, etc.)"));
//About
g_defaultStrings.insert(LANG_STRINGS::value_type(ABOUT_ABOUT_TITLE, "About GLideN64"));
g_defaultStrings.insert(LANG_STRINGS::value_type(ABOUT_TAB_ABOUT, "About"));
g_defaultStrings.insert(LANG_STRINGS::value_type(ABOUT_TAB_CONTRIBUTORS, "Contributors"));
g_defaultStrings.insert(LANG_STRINGS::value_type(ABOUT_TAB_FUNDERS, "Funders"));
g_defaultStrings.insert(LANG_STRINGS::value_type(ABOUT_TAB_CREDITS, "Credits"));
g_defaultStrings.insert(LANG_STRINGS::value_type(ABOUT_NEXT_GENERATION, "The next generation open source graphics plugin for N64 emulators."));
g_defaultStrings.insert(LANG_STRINGS::value_type(ABOUT_AUTHORS, "Authors"));
g_defaultStrings.insert(LANG_STRINGS::value_type(ABOUT_DEVELOPER, "Developer"));
g_defaultStrings.insert(LANG_STRINGS::value_type(ABOUT_BETA_TESTER, "Beta tester"));
g_defaultStrings.insert(LANG_STRINGS::value_type(ABOUT_GUI_DESIGNER, "GUI designer"));
g_defaultStrings.insert(LANG_STRINGS::value_type(ABOUT_AND_MORE, "... and more"));
g_defaultStrings.insert(LANG_STRINGS::value_type(ABOUT_AUTHOR_GLN64, "Author of the original glN64 graphics plugin"));
g_defaultStrings.insert(LANG_STRINGS::value_type(ABOUT_AUTHOR_GLES2N64, "Author of gles2n64, a port of glN64 to GL ES 2.0"));
g_defaultStrings.insert(LANG_STRINGS::value_type(ABOUT_AUTHOR_GLIDEHQ, "Author of the GlideHQ texture library"));
g_defaultStrings.insert(LANG_STRINGS::value_type(ABOUT_AUTHOR_Z64, "Author of z64, an OpenGL LLE plugin"));
}
LANG_STRINGS GetDefaultStrings(void)
{
if (g_defaultStrings.size() == 0)
LoadDefaultStrings();
return g_defaultStrings;
}
LANG_STR GetNextLangString(FILE * file)
{
if (feof(file))
return LANG_STR(0, "");
char token = 0;
char prevtoken = 0;
while (token != '#' && !feof(file))
fread(&token, 1, 1, file);
if (feof(file))
return LANG_STR(0, "");
int32_t StringID;
fscanf_s(file, "%d", &StringID);
token = 0;
while (token != '#' && !feof(file))
fread(&token, 1, 1, file);
if (feof(file))
return LANG_STR(0, "");
while (token != '"' && !feof(file))
fread(&token, 1, 1, file);
if (feof(file))
return LANG_STR(0, "");
fread(&token, 1, 1, file);
stdstr text;
while (!feof(file)) {
if (token == '"' && prevtoken != '\\') break; //escape quote
prevtoken = token;
text += token;
fread(&token, 1, 1, file);
}
text.Replace("\\n", "\n");
text.Replace("\\\"", "\"");
return LANG_STR(StringID, text);
}
bool LoadLanguageFile(const std::string & langFile)
{
if (g_defaultStrings.size() == 0)
LoadDefaultStrings();
g_currentStrings.clear();
if (g_debugLang)
return true;
FILE *file = NULL;
if (fopen_s(&file, langFile.c_str(), "rb") != 0 || file == NULL)
return false;
uint8_t utf_bom[3];
if (fread(&utf_bom, sizeof(utf_bom), 1, file) != 1 || utf_bom[0] != 0xEF || utf_bom[1] != 0xBB || utf_bom[2] != 0xBF) {
fclose(file);
return false;
}
while (!feof(file))
g_currentStrings.insert(GetNextLangString(file));
fclose(file);
return true;
}
void LoadCurrentStrings(const char * path, const std::string & lang)
{
std::string translationsFolder(path);
std::replace(translationsFolder.begin(), translationsFolder.end(), '/', '\\');
if (translationsFolder[translationsFolder.length() - 1] != '\\')
{
translationsFolder += '\\';
}
translationsFolder += "translations\\";
if (lang.length() > 0)
{
std::string langFile = translationsFolder + lang;
if (LoadLanguageFile(langFile))
{
return;
}
}
if (g_defaultStrings.size() == 0)
LoadDefaultStrings();
g_currentStrings.clear();
}
std::string GetLangString(const char * FileName, languageStringID ID)
{
FILE *file = NULL;
if (fopen_s(&file, FileName, "rb") != 0 || file == NULL)
return "";
uint8_t utf_bom[3];
if (fread(&utf_bom, sizeof(utf_bom), 1, file) != 1 ||
utf_bom[0] != 0xEF ||
utf_bom[1] != 0xBB ||
utf_bom[2] != 0xBF)
{
fclose(file);
return "";
}
while (!feof(file)) {
LANG_STR String = GetNextLangString(file);
if (String.first == ID) {
fclose(file);
return String.second;
}
}
fclose(file);
return "";
}
LanguageList GetLanguageList(const char * path)
{
std::string pluginFolder(path);
std::replace(pluginFolder.begin(), pluginFolder.end(), '/', '\\');
if (pluginFolder[pluginFolder.length() - 1] != '\\')
{
pluginFolder += '\\';
}
pluginFolder += "translations\\";
std::string nameFilters = pluginFolder + "gliden64_*.Lang";
WIN32_FIND_DATAA FindData;
HANDLE hFindFile = FindFirstFileA(nameFilters.c_str(), &FindData); // Find anything
LanguageList languages;
if (hFindFile != INVALID_HANDLE_VALUE) {
do {
std::string langFile = pluginFolder + FindData.cFileName;
LanguageFile file;
file.Filename = FindData.cFileName;
file.LanguageName = GetLangString(langFile.c_str(), LANGUAGE_NAME);
if (file.LanguageName.length() == 0 || file.LanguageName == stdstr().FromUTF16(L"English"))
continue;
languages.push_back(file);
} while (FindNextFileA(hFindFile, &FindData));
FindClose(hFindFile);
}
return languages;
}
const std::string & GetString(languageStringID stringID)
{
LANG_STRINGS::iterator currentString = g_currentStrings.find(stringID);
if (currentString != g_currentStrings.end())
return currentString->second;
if (g_debugLang) {
char debugStr[300];
sprintf_s(debugStr, "#%d#", stringID);
std::pair<LANG_STRINGS::iterator, bool> ret = g_currentStrings.insert(LANG_STRINGS::value_type(stringID, debugStr));
if (ret.second)
return ret.first->second;
}
LANG_STRINGS::iterator DefString = g_defaultStrings.find(stringID);
if (DefString != g_defaultStrings.end())
{
return DefString->second;
}
static std::string emptyString;
return emptyString;
}
std::wstring wGS(languageStringID StringID)
{
return stdstr(GetString(StringID)).ToUTF16();
}

View File

@ -1,261 +0,0 @@
#pragma once
#include <list>
#include <map>
#include "util/StdString.h"
enum languageStringID
{
/*********************************************************************************
* Meta Information *
*********************************************************************************/
LANGUAGE_NAME = 1,
/*********************************************************************************
* Config Dialog *
*********************************************************************************/
TAB_VIDEO = 1000,
TAB_EMULATION = 1001,
TAB_FRAME_BUFFER = 1002,
TAB_TEXTURE_ENHANCEMENT = 1003,
TAB_OSD = 1004,
TAB_DEBUG = 1005,
CFG_SAVE_SETTINGS_FOR = 1010,
CFG_SETTINGS_PROFILE = 1011,
CFG_REMOVE = 1012,
CFG_RESTORE_DEFAULTS = 1013,
CFG_SAVE_AND_CLOSE = 1014,
CFG_SAVE = 1015,
CFG_CLOSE = 1016,
/*********************************************************************************
* Video Tab *
*********************************************************************************/
VIDEO_GROUP = 2000,
VIDEO_FULL_SCREEN_RES = 2001,
VIDEO_FULL_SCREEN_RES_TOOLTIP = 2002,
VIDEO_REFRESH_RATE = 2003,
VIDEO_REFRESH_RATE_TOOLTIP = 2004,
VIDEO_WINDOWED_RESOLUTION = 2005,
VIDEO_WINDOWED_RESOLUTION_TOOLTIP = 2006,
VIDEO_ASPECT_RATIO = 2007,
VIDEO_ASPECT_RATIO_TOOLTIP = 2008,
VIDEO_ASPECT_4_3 = 2009,
VIDEO_ASPECT_16_19 = 2010,
VIDEO_ASPECT_STRETCH = 2011,
VIDEO_ASPECT_ADJUST = 2012,
VIDEO_VSYNC = 2013,
VIDEO_VSYNC_TOOLTIP = 2014,
VIDEO_THREADED_VIDEO = 2015,
VIDEO_THREADED_VIDEO_TOOLTIP = 2016,
VIDEO_OVERSCAN = 2017,
VIDEO_OVERSCAN_TOOLTIP = 2018,
VIDEO_NTSC = 2019,
VIDEO_PAL = 2020,
VIDEO_ANTI_ALIASING = 2021,
VIDEO_NO_ANTI_ALIASING = 2022,
VIDEO_FAST_ANTI_ALIASING = 2023,
VIDEO_MULTISAMPLE_ANTI_ALIASING = 2024,
VIDEO_AA_OFF = 2025,
VIDEO_AA_HIGH = 2026,
VIDEO_AA_TOOLTIP = 2027,
VIDEO_AA_INFO = 2028,
VIDEO_FILTERING_GROUP = 2029,
VIDEO_ANISOTROPIC = 2030,
VIDEO_ANISOTROPIC_OFF = 2031,
VIDEO_ANISOTROPIC_HIGH = 2032,
VIDEO_BILINEAR = 2033,
VIDEO_BILINEAR_STANDARD = 2034,
VIDEO_BILINEAR_3POINT = 2035,
VIDEO_BILINEAR_TOOLTIP = 2036,
VIDEO_DITHERING_GROUP = 2037,
VIDEO_PATTERN = 2038,
VIDEO_DITHERING_APPLY_TO_OUTPUT = 2039,
VIDEO_DITHERING_APPLY_TO_OUTPUT_TOOLTIP = 2040,
VIDEO_DITHERING_5BIT_QUANTIZATION = 2041,
VIDEO_DITHERING_5BIT_QUANTIZATION_TOOLTIP = 2042,
VIDEO_DITHERING_HIRES_NOISE = 2043,
VIDEO_DITHERING_HIRES_NOISE_TOOLTIP = 2044,
VIDEO_DITHERING_MODE_TOOLTIP = 2045,
VIDEO_DITHERING_DISABLE = 2046,
VIDEO_DITHERING_BAYER = 2047,
VIDEO_DITHERING_MAGIC_SQUARE = 2048,
VIDEO_DITHERING_BLUE_NOISE = 2049,
VIDEO_LANGUAGE = 2050,
/*********************************************************************************
* Emulation Tab *
*********************************************************************************/
EMULATION_USE_PER_GAME = 3000,
EMULATION_USE_PER_GAME_TOOLTIP = 3001,
EMULATION_N64_STYLE_MIP_MAPPING = 3002,
EMULATION_N64_STYLE_MIP_MAPPING_TOOLTIP = 3003,
EMULATION_HWLIGHTING = 3004,
EMULATION_HWLIGHTING_TOOLTIP = 3005,
EMULATION_SHADERS_STORAGE = 3006,
EMULATION_SHADERS_STORAGE_TOOLTIP = 3007,
EMULATION_INTERNAL_RES = 3008,
EMULATION_INTERNAL_RES_TOOLTIP = 3009,
EMULATION_FACTOR0X = 3010,
EMULATION_FACTOR1X = 3011,
EMULATION_FACTORXX = 3012,
EMULATION_GAMMA = 3013,
EMULATION_GAMMA_TOOLTIP = 3014,
EMULATION_GAMMA_CORRECTION = 3015,
EMULATION_GAMMA_INFO = 3016,
EMULATION_2D_ELEMENTS = 3017,
EMULATION_RENDER_2D_ELEMENTS = 3018,
EMULATION_RENDER_2D_TOOLTIP = 3019,
EMULATION_RENDER_DISABLE = 3020,
EMULATION_RENDER_ENABLE_OPTIMIZED = 3021,
EMULATION_RENDER_ENABLE_UNOPTIMIZED = 3022,
EMULATION_HALOS_REMOVAL = 3023,
EMULATION_FIX_BLACK_LINES = 3024,
EMULATION_FIX_BLACK_LINES_TOOLTIP = 3025,
EMULATION_ADJACENT_2D_ELEMENTS = 3026,
EMULATION_ALWAYS = 3027,
EMULATION_NEVER = 3028,
EMULATION_BACKGROUND = 3029,
EMULATION_BACKGROUND_TOOLTIP = 3030,
EMULATION_ONE_PIECE = 3031,
EMULATION_STRIPPED = 3032,
EMULATION_PIXEL_COVERAGE = 3033,
EMULATION_PIXEL_COVERAGE_TOOLTIP = 3034,
/*********************************************************************************
* Frame Buffer Tab *
*********************************************************************************/
FRAMEBUFFER_ENABLE = 4000,
FRAMEBUFFER_ENABLE_INFO = 4001,
FRAMEBUFFER_COPY_AUX_BUFFERS = 4002,
FRAMEBUFFER_COPY_AUX_BUFFERS_TOOLTIP = 4003,
FRAMEBUFFER_SWAP = 4004,
FRAMEBUFFER_SWAP_TOOLTIP = 4005,
FRAMEBUFFER_VERTICAL_INTERRUPT = 4006,
FRAMEBUFFER_VI_ORIGIN_CHANGE = 4007,
FRAMEBUFFER_COLOR_BUFFER_CHANGE = 4008,
FRAMEBUFFER_INFO_ENABLE = 4009,
FRAMEBUFFER_INFO_ENABLE_TOOLTIP = 4010,
FRAMEBUFFER_READ_COLOR_CHUNK = 4011,
FRAMEBUFFER_READ_COLOR_CHUNK_TOOLTIP = 4012,
FRAMEBUFFER_READ_DEPTH_CHUNK = 4013,
FRAMEBUFFER_READ_DEPTH_CHUNK_TOOLTIP = 4014,
FRAMEBUFFER_COPY_COLOR_BUFFER = 4015,
FRAMEBUFFER_COPY_COLOR_BUFFER_TOOLTIP = 4016,
FRAMEBUFFER_COPY_NEVER = 4017,
FRAMEBUFFER_COPY_SYNCHRONOUS = 4018,
FRAMEBUFFER_COPY_ASYNCHRONOUS = 4019,
FRAMEBUFFER_COPY_DEPTH_BUFFER = 4020,
FRAMEBUFFER_COPY_DEPTH_BUFFER_TOOLTIP = 4021,
FRAMEBUFFER_COPY_DEPTH_NEVER = 4022,
FRAMEBUFFER_COPY_DEPTH_VRAM = 4023,
FRAMEBUFFER_COPY_DEPTH_SOFTWARE = 4024,
FRAMEBUFFER_N64_DEPTH_COMPARE = 4025,
FRAMEBUFFER_N64_DEPTH_COMPARE_TOOLTIP = 4026,
FRAMEBUFFER_N64_DEPTH_DISABLE = 4027,
FRAMEBUFFER_N64_DEPTH_FAST = 4028,
FRAMEBUFFER_N64_DEPTH_COMPATIBLE = 4029,
FRAMEBUFFER_FORCE_DEPTH_BUFFER_CLEAR = 4030,
FRAMEBUFFER_FORCE_DEPTH_BUFFER_CLEAR_TOOLTIP = 4031,
FRAMEBUFFER_RENDER_FRAMEBUFFER = 4032,
FRAMEBUFFER_RENDER_FRAMEBUFFER_TOOLTIP = 4033,
FRAMEBUFFER_COPY_DEPTH_TO_MAIN = 4034,
FRAMEBUFFER_COPY_DEPTH_TO_MAIN_TOOLTIP = 4035,
/*********************************************************************************
* Texture Enhancement Tab *
*********************************************************************************/
TEXTURE_N64_TEXTURES_GROUP = 5000,
TEXTURE_N64_FILTER = 5001,
TEXTURE_N64_FILTER_TOOLTIP = 5002,
TEXTURE_N64_FILTER_NONE = 5003,
TEXTURE_N64_FILTER_SMOOTH1 = 5004,
TEXTURE_N64_FILTER_SMOOTH2 = 5005,
TEXTURE_N64_FILTER_SMOOTH3 = 5006,
TEXTURE_N64_FILTER_SMOOTH4 = 5007,
TEXTURE_N64_FILTER_SHARP1 = 5008,
TEXTURE_N64_FILTER_SHARP2 = 5009,
TEXTURE_ENHANCEMENT = 5010,
TEXTURE_ENHANCEMENT_TOOLTIP = 5011,
TEXTURE_ENHANCEMENT_NONE = 5012,
TEXTURE_ENHANCEMENT_STORE = 5013,
TEXTURE_DECREASE_COLOR = 5014,
TEXTURE_DECREASE_COLOR_TOOLTIP = 5015,
TEXTURE_IGNORE_BACKGROUNDS = 5016,
TEXTURE_IGNORE_BACKGROUNDS_TOOLTIP = 5017,
TEXTURE_USE_FILE_STORAGE = 5018,
TEXTURE_USE_TEXTURE_PACK = 5019,
TEXTURE_TEXTURE_PACK = 5020,
TEXTURE_TEXTURE_PACK_TOOLTIP = 5021,
TEXTURE_CACHE_PATH = 5022,
TEXTURE_DUMP_PATH = 5023,
TEXTURE_USE_FULL_TRANSPARENCIES = 5024,
TEXTURE_USE_FULL_TRANSPARENCIES_TOOLTIP = 5025,
TEXTURE_ALTERNATIVE_CRC = 5026,
TEXTURE_ALTERNATIVE_CRC_TOOLTIP = 5027,
TEXTURE_USE_FILE_STORAGE_TOOLTIP = 5028,
TEXTURE_SIZE_OF_MEMORY_CACHE = 5031,
TEXTURE_SIZE_OF_MEMORY_CACHE_TOOLTIP = 5032,
TEXTURE_SAVE_ENHANCED = 5033,
TEXTURE_SAVE_ENHANCED_TOOLTIP = 5034,
TEXTURE_COMPRESS_CACHE = 5035,
TEXTURE_COMPRESS_CACHE_TOOLTIP = 5036,
TEXTURE_CONVERT_16BPP = 5037,
TEXTURE_CONVERT_16BPP_TOOLTIP = 5038,
TEXTURE_RELOAD = 5039,
TEXTURE_RELOAD_TOOLTIP = 5040,
/*********************************************************************************
* On-screen display *
*********************************************************************************/
OSD_POSITION = 6000,
OSD_DISPLAY_FPS = 6001,
OSD_DISPLAY_VI = 6002,
OSD_DISPLAY_PERCENTAGE = 6003,
OSD_DISPLAY_INTERNAL_RESOLUTION = 6004,
OSD_DISPLAY_RENDERING_RESOLUTION = 6005,
OSD_FONT = 6006,
OSD_SIZE = 6007,
OSD_PX = 6008,
OSD_COLOR = 6009,
OSD_PREVIEW = 6010,
/*********************************************************************************
* Debug *
*********************************************************************************/
DEBUG_DUMP_LOWLEVEL_INFO = 7000,
DEBUG_DUMP_DISPLAY_LIST = 7001,
DEBUG_DUMP_DETAILED_INFO = 7002,
/*********************************************************************************
* About *
*********************************************************************************/
ABOUT_ABOUT_TITLE = 9000,
ABOUT_TAB_ABOUT = 9001,
ABOUT_TAB_CONTRIBUTORS = 9002,
ABOUT_TAB_FUNDERS = 9003,
ABOUT_TAB_CREDITS = 9004,
ABOUT_NEXT_GENERATION = 9005,
ABOUT_AUTHORS = 9006,
ABOUT_DEVELOPER = 9007,
ABOUT_BETA_TESTER = 9008,
ABOUT_GUI_DESIGNER = 9009,
ABOUT_AND_MORE = 9010,
ABOUT_AUTHOR_GLN64 = 9011,
ABOUT_AUTHOR_GLES2N64 = 9012,
ABOUT_AUTHOR_GLIDEHQ = 9013,
ABOUT_AUTHOR_Z64 = 9014,
};
struct LanguageFile
{
std::string Filename;
std::string LanguageName;
};
typedef std::list<LanguageFile> LanguageList;
typedef std::map<int32_t, stdstr> LANG_STRINGS;
typedef LANG_STRINGS::value_type LANG_STR;
void LoadCurrentStrings(const char * path, const std::string & lang);
LanguageList GetLanguageList(const char * path);
LANG_STRINGS GetDefaultStrings(void);
std::wstring wGS(languageStringID StringID);

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,685 +0,0 @@
// Windows Template Library - WTL version 8.1
// Copyright (C) Microsoft Corporation. All rights reserved.
//
// This file is a part of the Windows Template Library.
// The use and distribution terms for this software are covered by the
// Common Public License 1.0 (http://opensource.org/licenses/cpl1.0.php)
// which can be found in the file CPL.TXT at the root of this distribution.
// By using this software in any fashion, you are agreeing to be bound by
// the terms of this license. You must not remove this notice, or
// any other, from this software.
#ifndef __ATLDDX_H__
#define __ATLDDX_H__
#pragma once
#ifndef __ATLAPP_H__
#error atlddx.h requires atlapp.h to be included first
#endif
#if defined(_ATL_USE_DDX_FLOAT) && defined(_ATL_MIN_CRT)
#error Cannot use floating point DDX with _ATL_MIN_CRT defined
#endif // defined(_ATL_USE_DDX_FLOAT) && defined(_ATL_MIN_CRT)
#ifdef _ATL_USE_DDX_FLOAT
#include <float.h>
#endif // _ATL_USE_DDX_FLOAT
///////////////////////////////////////////////////////////////////////////////
// Classes in this file:
//
// CWinDataExchange<T>
namespace WTL
{
// Constants
#define DDX_LOAD FALSE
#define DDX_SAVE TRUE
// DDX map macros
#define BEGIN_DDX_MAP(thisClass) \
BOOL DoDataExchange(BOOL bSaveAndValidate = FALSE, UINT nCtlID = (UINT)-1) \
{ \
bSaveAndValidate; \
nCtlID;
#define DDX_TEXT(nID, var) \
if(nCtlID == (UINT)-1 || nCtlID == nID) \
{ \
if(!DDX_Text(nID, var, sizeof(var), bSaveAndValidate)) \
return FALSE; \
}
#define DDX_TEXT_LEN(nID, var, len) \
if(nCtlID == (UINT)-1 || nCtlID == nID) \
{ \
if(!DDX_Text(nID, var, sizeof(var), bSaveAndValidate, TRUE, len)) \
return FALSE; \
}
#define DDX_INT(nID, var) \
if(nCtlID == (UINT)-1 || nCtlID == nID) \
{ \
if(!DDX_Int(nID, var, TRUE, bSaveAndValidate)) \
return FALSE; \
}
#define DDX_INT_RANGE(nID, var, min, max) \
if(nCtlID == (UINT)-1 || nCtlID == nID) \
{ \
if(!DDX_Int(nID, var, TRUE, bSaveAndValidate, TRUE, min, max)) \
return FALSE; \
}
#define DDX_UINT(nID, var) \
if(nCtlID == (UINT)-1 || nCtlID == nID) \
{ \
if(!DDX_Int(nID, var, FALSE, bSaveAndValidate)) \
return FALSE; \
}
#define DDX_UINT_RANGE(nID, var, min, max) \
if(nCtlID == (UINT)-1 || nCtlID == nID) \
{ \
if(!DDX_Int(nID, var, FALSE, bSaveAndValidate, TRUE, min, max)) \
return FALSE; \
}
#ifdef _ATL_USE_DDX_FLOAT
#define DDX_FLOAT(nID, var) \
if(nCtlID == (UINT)-1 || nCtlID == nID) \
{ \
if(!DDX_Float(nID, var, bSaveAndValidate)) \
return FALSE; \
}
#define DDX_FLOAT_RANGE(nID, var, min, max) \
if(nCtlID == (UINT)-1 || nCtlID == nID) \
{ \
if(!DDX_Float(nID, var, bSaveAndValidate, TRUE, min, max)) \
return FALSE; \
}
#define DDX_FLOAT_P(nID, var, precision) \
if(nCtlID == (UINT)-1 || nCtlID == nID) \
{ \
if(!DDX_Float(nID, var, bSaveAndValidate, FALSE, 0, 0, precision)) \
return FALSE; \
}
#define DDX_FLOAT_P_RANGE(nID, var, min, max, precision) \
if(nCtlID == (UINT)-1 || nCtlID == nID) \
{ \
if(!DDX_Float(nID, var, bSaveAndValidate, TRUE, min, max, precision)) \
return FALSE; \
}
#endif // _ATL_USE_DDX_FLOAT
#define DDX_CONTROL(nID, obj) \
if(nCtlID == (UINT)-1 || nCtlID == nID) \
DDX_Control(nID, obj, bSaveAndValidate);
#define DDX_CONTROL_HANDLE(nID, obj) \
if(nCtlID == (UINT)-1 || nCtlID == nID) \
DDX_Control_Handle(nID, obj, bSaveAndValidate);
#define DDX_CHECK(nID, var) \
if(nCtlID == (UINT)-1 || nCtlID == nID) \
DDX_Check(nID, var, bSaveAndValidate);
#define DDX_RADIO(nID, var) \
if(nCtlID == (UINT)-1 || nCtlID == nID) \
DDX_Radio(nID, var, bSaveAndValidate);
#define END_DDX_MAP() \
return TRUE; \
}
// DDX support for Tab, Combo, ListBox and ListView selection index
// Note: Specialized versions require atlctrls.h to be included first
#if (_MSC_VER >= 1300)
#define DDX_INDEX(CtrlClass, nID, var) \
if(nCtlID == (UINT)-1 || nCtlID == nID) \
DDX_Index<CtrlClass>(nID, var, bSaveAndValidate);
#ifdef __ATLCTRLS_H__
#define DDX_TAB_INDEX(nID, var) DDX_INDEX(WTL::CTabCtrl, nID, var)
#define DDX_COMBO_INDEX(nID, var) DDX_INDEX(WTL::CComboBox, nID, var)
#define DDX_LISTBOX_INDEX(nID, var) DDX_INDEX(WTL::CListBox, nID, var)
#define DDX_LISTVIEW_INDEX(nID, var) DDX_INDEX(WTL::CListViewCtrl, nID, var)
#endif // __ATLCTRLS_H__
#endif // (_MSC_VER >= 1300)
///////////////////////////////////////////////////////////////////////////////
// CWinDataExchange - provides support for DDX
template <class T>
class CWinDataExchange
{
public:
// Data exchange method - override in your derived class
BOOL DoDataExchange(BOOL /*bSaveAndValidate*/ = FALSE, UINT /*nCtlID*/ = (UINT)-1)
{
// this one should never be called, override it in
// your derived class by implementing DDX map
ATLASSERT(FALSE);
return FALSE;
}
// Helpers for validation error reporting
enum _XDataType
{
ddxDataNull = 0,
ddxDataText = 1,
ddxDataInt = 2,
ddxDataFloat = 3,
ddxDataDouble = 4
};
struct _XTextData
{
int nLength;
int nMaxLength;
};
struct _XIntData
{
long nVal;
long nMin;
long nMax;
};
struct _XFloatData
{
double nVal;
double nMin;
double nMax;
};
struct _XData
{
_XDataType nDataType;
union
{
_XTextData textData;
_XIntData intData;
_XFloatData floatData;
};
};
// Text exchange
BOOL DDX_Text(UINT nID, LPTSTR lpstrText, int cbSize, BOOL bSave, BOOL bValidate = FALSE, int nLength = 0)
{
T* pT = static_cast<T*>(this);
BOOL bSuccess = TRUE;
if(bSave)
{
HWND hWndCtrl = pT->GetDlgItem(nID);
int nRetLen = ::GetWindowText(hWndCtrl, lpstrText, cbSize / sizeof(TCHAR));
if(nRetLen < ::GetWindowTextLength(hWndCtrl))
bSuccess = FALSE;
}
else
{
ATLASSERT(!bValidate || lstrlen(lpstrText) <= nLength);
bSuccess = pT->SetDlgItemText(nID, lpstrText);
}
if(!bSuccess)
{
pT->OnDataExchangeError(nID, bSave);
}
else if(bSave && bValidate) // validation
{
ATLASSERT(nLength > 0);
if(lstrlen(lpstrText) > nLength)
{
_XData data = { ddxDataText };
data.textData.nLength = lstrlen(lpstrText);
data.textData.nMaxLength = nLength;
pT->OnDataValidateError(nID, bSave, data);
bSuccess = FALSE;
}
}
return bSuccess;
}
BOOL DDX_Text(UINT nID, BSTR& bstrText, int /*cbSize*/, BOOL bSave, BOOL bValidate = FALSE, int nLength = 0)
{
T* pT = static_cast<T*>(this);
BOOL bSuccess = TRUE;
if(bSave)
{
bSuccess = pT->GetDlgItemText(nID, bstrText);
}
else
{
USES_CONVERSION;
LPTSTR lpstrText = OLE2T(bstrText);
ATLASSERT(!bValidate || lstrlen(lpstrText) <= nLength);
bSuccess = pT->SetDlgItemText(nID, lpstrText);
}
if(!bSuccess)
{
pT->OnDataExchangeError(nID, bSave);
}
else if(bSave && bValidate) // validation
{
ATLASSERT(nLength > 0);
if((int)::SysStringLen(bstrText) > nLength)
{
_XData data = { ddxDataText };
data.textData.nLength = (int)::SysStringLen(bstrText);
data.textData.nMaxLength = nLength;
pT->OnDataValidateError(nID, bSave, data);
bSuccess = FALSE;
}
}
return bSuccess;
}
BOOL DDX_Text(UINT nID, ATL::CComBSTR& bstrText, int /*cbSize*/, BOOL bSave, BOOL bValidate = FALSE, int nLength = 0)
{
T* pT = static_cast<T*>(this);
BOOL bSuccess = TRUE;
if(bSave)
{
bSuccess = pT->GetDlgItemText(nID, (BSTR&)bstrText);
}
else
{
USES_CONVERSION;
LPTSTR lpstrText = OLE2T(bstrText);
ATLASSERT(!bValidate || lstrlen(lpstrText) <= nLength);
bSuccess = pT->SetDlgItemText(nID, lpstrText);
}
if(!bSuccess)
{
pT->OnDataExchangeError(nID, bSave);
}
else if(bSave && bValidate) // validation
{
ATLASSERT(nLength > 0);
if((int)bstrText.Length() > nLength)
{
_XData data = { ddxDataText };
data.textData.nLength = (int)bstrText.Length();
data.textData.nMaxLength = nLength;
pT->OnDataValidateError(nID, bSave, data);
bSuccess = FALSE;
}
}
return bSuccess;
}
#if defined(_WTL_USE_CSTRING) || defined(__ATLSTR_H__)
BOOL DDX_Text(UINT nID, _CSTRING_NS::CString& strText, int /*cbSize*/, BOOL bSave, BOOL bValidate = FALSE, int nLength = 0)
{
T* pT = static_cast<T*>(this);
BOOL bSuccess = TRUE;
if(bSave)
{
HWND hWndCtrl = pT->GetDlgItem(nID);
int nLen = ::GetWindowTextLength(hWndCtrl);
int nRetLen = -1;
LPTSTR lpstr = strText.GetBufferSetLength(nLen);
if(lpstr != NULL)
{
nRetLen = ::GetWindowText(hWndCtrl, lpstr, nLen + 1);
strText.ReleaseBuffer();
}
if(nRetLen < nLen)
bSuccess = FALSE;
}
else
{
bSuccess = pT->SetDlgItemText(nID, strText);
}
if(!bSuccess)
{
pT->OnDataExchangeError(nID, bSave);
}
else if(bSave && bValidate) // validation
{
ATLASSERT(nLength > 0);
if(strText.GetLength() > nLength)
{
_XData data = { ddxDataText };
data.textData.nLength = strText.GetLength();
data.textData.nMaxLength = nLength;
pT->OnDataValidateError(nID, bSave, data);
bSuccess = FALSE;
}
}
return bSuccess;
}
#endif // defined(_WTL_USE_CSTRING) || defined(__ATLSTR_H__)
// Numeric exchange
template <class Type>
BOOL DDX_Int(UINT nID, Type& nVal, BOOL bSigned, BOOL bSave, BOOL bValidate = FALSE, Type nMin = 0, Type nMax = 0)
{
T* pT = static_cast<T*>(this);
BOOL bSuccess = TRUE;
if(bSave)
{
nVal = (Type)pT->GetDlgItemInt(nID, &bSuccess, bSigned);
}
else
{
ATLASSERT(!bValidate || nVal >= nMin && nVal <= nMax);
bSuccess = pT->SetDlgItemInt(nID, nVal, bSigned);
}
if(!bSuccess)
{
pT->OnDataExchangeError(nID, bSave);
}
else if(bSave && bValidate) // validation
{
ATLASSERT(nMin != nMax);
if(nVal < nMin || nVal > nMax)
{
_XData data = { ddxDataInt };
data.intData.nVal = (long)nVal;
data.intData.nMin = (long)nMin;
data.intData.nMax = (long)nMax;
pT->OnDataValidateError(nID, bSave, data);
bSuccess = FALSE;
}
}
return bSuccess;
}
// Float exchange
#ifdef _ATL_USE_DDX_FLOAT
static BOOL _AtlSimpleFloatParse(LPCTSTR lpszText, double& d)
{
ATLASSERT(lpszText != NULL);
while (*lpszText == _T(' ') || *lpszText == _T('\t'))
lpszText++;
TCHAR chFirst = lpszText[0];
d = _tcstod(lpszText, (LPTSTR*)&lpszText);
if (d == 0.0 && chFirst != _T('0'))
return FALSE; // could not convert
while (*lpszText == _T(' ') || *lpszText == _T('\t'))
lpszText++;
if (*lpszText != _T('\0'))
return FALSE; // not terminated properly
return TRUE;
}
BOOL DDX_Float(UINT nID, float& nVal, BOOL bSave, BOOL bValidate = FALSE, float nMin = 0.F, float nMax = 0.F, int nPrecision = FLT_DIG)
{
T* pT = static_cast<T*>(this);
BOOL bSuccess = TRUE;
const int cchBuff = 32;
TCHAR szBuff[cchBuff] = { 0 };
if(bSave)
{
pT->GetDlgItemText(nID, szBuff, cchBuff);
double d = 0;
if(_AtlSimpleFloatParse(szBuff, d))
nVal = (float)d;
else
bSuccess = FALSE;
}
else
{
ATLASSERT(!bValidate || nVal >= nMin && nVal <= nMax);
SecureHelper::sprintf_x(szBuff, cchBuff, _T("%.*g"), nPrecision, nVal);
bSuccess = pT->SetDlgItemText(nID, szBuff);
}
if(!bSuccess)
{
pT->OnDataExchangeError(nID, bSave);
}
else if(bSave && bValidate) // validation
{
ATLASSERT(nMin != nMax);
if(nVal < nMin || nVal > nMax)
{
_XData data = { ddxDataFloat };
data.floatData.nVal = (double)nVal;
data.floatData.nMin = (double)nMin;
data.floatData.nMax = (double)nMax;
pT->OnDataValidateError(nID, bSave, data);
bSuccess = FALSE;
}
}
return bSuccess;
}
BOOL DDX_Float(UINT nID, double& nVal, BOOL bSave, BOOL bValidate = FALSE, double nMin = 0., double nMax = 0., int nPrecision = DBL_DIG)
{
T* pT = static_cast<T*>(this);
BOOL bSuccess = TRUE;
const int cchBuff = 32;
TCHAR szBuff[cchBuff] = { 0 };
if(bSave)
{
pT->GetDlgItemText(nID, szBuff, cchBuff);
double d = 0;
if(_AtlSimpleFloatParse(szBuff, d))
nVal = d;
else
bSuccess = FALSE;
}
else
{
ATLASSERT(!bValidate || nVal >= nMin && nVal <= nMax);
SecureHelper::sprintf_x(szBuff, cchBuff, _T("%.*g"), nPrecision, nVal);
bSuccess = pT->SetDlgItemText(nID, szBuff);
}
if(!bSuccess)
{
pT->OnDataExchangeError(nID, bSave);
}
else if(bSave && bValidate) // validation
{
ATLASSERT(nMin != nMax);
if(nVal < nMin || nVal > nMax)
{
_XData data = { ddxDataFloat };
data.floatData.nVal = nVal;
data.floatData.nMin = nMin;
data.floatData.nMax = nMax;
pT->OnDataValidateError(nID, bSave, data);
bSuccess = FALSE;
}
}
return bSuccess;
}
#endif // _ATL_USE_DDX_FLOAT
// Full control subclassing (for CWindowImpl derived controls)
template <class TControl>
void DDX_Control(UINT nID, TControl& ctrl, BOOL bSave)
{
if(!bSave && ctrl.m_hWnd == NULL)
{
T* pT = static_cast<T*>(this);
ctrl.SubclassWindow(pT->GetDlgItem(nID));
}
}
// Simple control attaching (for HWND wrapper controls)
template <class TControl>
void DDX_Control_Handle(UINT nID, TControl& ctrl, BOOL bSave)
{
if(!bSave && ctrl.m_hWnd == NULL)
{
T* pT = static_cast<T*>(this);
ctrl = pT->GetDlgItem(nID);
}
}
// Control state
void DDX_Check(UINT nID, int& nValue, BOOL bSave)
{
T* pT = static_cast<T*>(this);
HWND hWndCtrl = pT->GetDlgItem(nID);
if(bSave)
{
nValue = (int)::SendMessage(hWndCtrl, BM_GETCHECK, 0, 0L);
ATLASSERT(nValue >= 0 && nValue <= 2);
}
else
{
if(nValue < 0 || nValue > 2)
{
ATLTRACE2(atlTraceUI, 0, _T("ATL: Warning - dialog data checkbox value (%d) out of range.\n"), nValue);
nValue = 0; // default to off
}
::SendMessage(hWndCtrl, BM_SETCHECK, nValue, 0L);
}
}
// variant that supports bool (checked/not-checked, no intermediate state)
void DDX_Check(UINT nID, bool& bCheck, BOOL bSave)
{
int nValue = bCheck ? 1 : 0;
DDX_Check(nID, nValue, bSave);
if(bSave)
{
if(nValue == 2)
ATLTRACE2(atlTraceUI, 0, _T("ATL: Warning - checkbox state (%d) out of supported range.\n"), nValue);
bCheck = (nValue == 1);
}
}
void DDX_Radio(UINT nID, int& nValue, BOOL bSave)
{
T* pT = static_cast<T*>(this);
HWND hWndCtrl = pT->GetDlgItem(nID);
ATLASSERT(hWndCtrl != NULL);
// must be first in a group of auto radio buttons
ATLASSERT(::GetWindowLong(hWndCtrl, GWL_STYLE) & WS_GROUP);
ATLASSERT(::SendMessage(hWndCtrl, WM_GETDLGCODE, 0, 0L) & DLGC_RADIOBUTTON);
if(bSave)
nValue = -1; // value if none found
// walk all children in group
int nButton = 0;
do
{
if(::SendMessage(hWndCtrl, WM_GETDLGCODE, 0, 0L) & DLGC_RADIOBUTTON)
{
// control in group is a radio button
if(bSave)
{
if(::SendMessage(hWndCtrl, BM_GETCHECK, 0, 0L) != 0)
{
ATLASSERT(nValue == -1); // only set once
nValue = nButton;
}
}
else
{
// select button
::SendMessage(hWndCtrl, BM_SETCHECK, (nButton == nValue), 0L);
}
nButton++;
}
else
{
ATLTRACE2(atlTraceUI, 0, _T("ATL: Warning - skipping non-radio button in group.\n"));
}
hWndCtrl = ::GetWindow(hWndCtrl, GW_HWNDNEXT);
}
while (hWndCtrl != NULL && !(GetWindowLong(hWndCtrl, GWL_STYLE) & WS_GROUP));
}
// DDX support for Tab, Combo, ListBox and ListView selection index
#if (_MSC_VER >= 1300)
template <class TCtrl>
INT _getSel(TCtrl& tCtrl)
{
return tCtrl.GetCurSel();
}
template <class TCtrl>
void _setSel(TCtrl& tCtrl, INT iSel)
{
if(iSel < 0)
tCtrl.SetCurSel(-1);
else
tCtrl.SetCurSel(iSel);
}
#ifdef __ATLCTRLS_H__
// ListViewCtrl specialization
template <>
INT _getSel(WTL::CListViewCtrl& tCtrl)
{
return tCtrl.GetSelectedIndex();
}
template <>
void _setSel(WTL::CListViewCtrl& tCtrl, INT iSel)
{
if(iSel < 0)
tCtrl.SelectItem(-1);
else
tCtrl.SelectItem(iSel);
}
#endif // __ATLCTRLS_H__
template <class TCtrl>
void DDX_Index(UINT nID, INT& nVal, BOOL bSave)
{
T* pT = static_cast<T*>(this);
TCtrl ctrl(pT->GetDlgItem(nID));
if(bSave)
nVal = _getSel(ctrl);
else
_setSel(ctrl, nVal);
}
#endif // (_MSC_VER >= 1300)
// Overrideables
void OnDataExchangeError(UINT nCtrlID, BOOL /*bSave*/)
{
// Override to display an error message
::MessageBeep((UINT)-1);
T* pT = static_cast<T*>(this);
::SetFocus(pT->GetDlgItem(nCtrlID));
}
void OnDataValidateError(UINT nCtrlID, BOOL /*bSave*/, _XData& /*data*/)
{
// Override to display an error message
::MessageBeep((UINT)-1);
T* pT = static_cast<T*>(this);
::SetFocus(pT->GetDlgItem(nCtrlID));
}
};
}; // namespace WTL
#endif // __ATLDDX_H__

File diff suppressed because it is too large Load Diff

View File

@ -1,461 +0,0 @@
// Windows Template Library - WTL version 8.1
// Copyright (C) Microsoft Corporation. All rights reserved.
//
// This file is a part of the Windows Template Library.
// The use and distribution terms for this software are covered by the
// Common Public License 1.0 (http://opensource.org/licenses/cpl1.0.php)
// which can be found in the file CPL.TXT at the root of this distribution.
// By using this software in any fashion, you are agreeing to be bound by
// the terms of this license. You must not remove this notice, or
// any other, from this software.
#ifndef __ATLDWM_H__
#define __ATLDWM_H__
#pragma once
#ifdef _WIN32_WCE
#error atldwm.h is not supported on Windows CE
#endif
#ifndef __ATLAPP_H__
#error atldwm.h requires atlapp.h to be included first
#endif
#ifndef __ATLWIN_H__
#error atldwm.h requires atlwin.h to be included first
#endif
#if (_WIN32_WINNT < 0x0600)
#error atldwm.h requires _WIN32_WINNT >= 0x0600
#endif // (_WIN32_WINNT < 0x0600)
#ifndef _DWMAPI_H_
#include <dwmapi.h>
#endif // _DWMAPI_H_
#pragma comment(lib, "dwmapi.lib")
// Note: To create an application that also runs on older versions of Windows,
// use delay load of dwmapi.dll and ensure that no calls to the DWM API are
// Delay load is NOT AUTOMATIC for VC++ 7, you have to link to delayimp.lib,
// and add dwmapi.dll in the Linker.Input.Delay Loaded DLLs section of the
// project properties.
#if (_MSC_VER < 1300) && !defined(_WTL_NO_DWMAPI_DELAYLOAD)
#pragma comment(lib, "delayimp.lib")
#pragma comment(linker, "/delayload:dwmapi.dll")
#endif // (_MSC_VER < 1300) && !defined(_WTL_NO_DWMAPI_DELAYLOAD)
///////////////////////////////////////////////////////////////////////////////
// Classes in this file:
//
// CDwm
// CDwmImpl<T, TBase>
// CDwmWindowT<TBase> - CDwmWindow
// CDwmThumbnailT<t_bManaged, TBase>
// CDwmThumbnail
// CDwmThumbnailHandle
// CAeroControlImpl
namespace WTL
{
///////////////////////////////////////////////////////////////////////////////
// CDwm - wrapper for DWM handle
class CDwm
{
public:
// Data members
static int m_nIsDwmSupported;
// Constructor
CDwm()
{
IsDwmSupported();
}
// Dwm support helper
static bool IsDwmSupported()
{
if(m_nIsDwmSupported == -1)
{
CStaticDataInitCriticalSectionLock lock;
if(FAILED(lock.Lock()))
{
ATLTRACE2(atlTraceUI, 0, _T("ERROR : Unable to lock critical section in CDwm::IsDwmSupported.\n"));
ATLASSERT(FALSE);
return false;
}
if(m_nIsDwmSupported == -1)
{
HMODULE hDwmDLL = ::LoadLibrary(_T("dwmapi.dll"));
m_nIsDwmSupported = (hDwmDLL != NULL) ? 1 : 0;
if(hDwmDLL != NULL)
::FreeLibrary(hDwmDLL);
}
lock.Unlock();
}
ATLASSERT(m_nIsDwmSupported != -1);
return (m_nIsDwmSupported == 1);
}
// Operations
BOOL DwmIsCompositionEnabled() const
{
if(!IsDwmSupported()) return FALSE;
BOOL bRes = FALSE;
return SUCCEEDED(::DwmIsCompositionEnabled(&bRes)) && bRes;
}
BOOL DwmEnableComposition(UINT fEnable)
{
if(!IsDwmSupported()) return FALSE;
return SUCCEEDED(::DwmEnableComposition(fEnable));
}
BOOL DwmEnableMMCSS(BOOL fEnableMMCSS)
{
if(!IsDwmSupported()) return FALSE;
return SUCCEEDED(::DwmEnableMMCSS(fEnableMMCSS));
}
HRESULT DwmGetColorizationColor(DWORD* pcrColorization, BOOL* pfOpaqueBlend)
{
if(!IsDwmSupported()) return E_NOTIMPL;
return ::DwmGetColorizationColor(pcrColorization, pfOpaqueBlend);
}
HRESULT DwmFlush()
{
if(!IsDwmSupported()) return E_NOTIMPL;
return ::DwmFlush();
}
};
__declspec(selectany) int CDwm::m_nIsDwmSupported = -1;
///////////////////////////////////////////////////////////////////////////////
// CDwmImpl - DWM window support
template <class T, class TBase = CDwm>
class CDwmImpl : public TBase
{
public:
HRESULT DwmEnableBlurBehindWindow(const DWM_BLURBEHIND* pBB)
{
if(!IsDwmSupported()) return E_NOTIMPL;
T* pT = static_cast<T*>(this);
ATLASSERT(::IsWindow(pT->m_hWnd));
return ::DwmEnableBlurBehindWindow(pT->m_hWnd, pBB);
}
HRESULT DwmExtendFrameIntoClientArea(const MARGINS* pMargins)
{
if(!IsDwmSupported()) return E_NOTIMPL;
T* pT = static_cast<T*>(this);
ATLASSERT(::IsWindow(pT->m_hWnd));
return ::DwmExtendFrameIntoClientArea(pT->m_hWnd, pMargins);
}
HRESULT DwmExtendFrameIntoEntireClientArea()
{
MARGINS margins = { -1 };
return DwmExtendFrameIntoClientArea(&margins);
}
HRESULT DwmGetCompositionTimingInfo(DWM_TIMING_INFO* pTimingInfo)
{
if(!IsDwmSupported()) return E_NOTIMPL;
T* pT = static_cast<T*>(this);
ATLASSERT(::IsWindow(pT->m_hWnd));
return ::DwmGetCompositionTimingInfo(pT->m_hWnd, pTimingInfo);
}
HRESULT DwmGetWindowAttribute(DWORD dwAttribute, PVOID pvAttribute, DWORD cbAttribute)
{
if(!IsDwmSupported()) return E_NOTIMPL;
T* pT = static_cast<T*>(this);
ATLASSERT(::IsWindow(pT->m_hWnd));
return ::DwmGetWindowAttribute(pT->m_hWnd, dwAttribute, pvAttribute, cbAttribute);
}
HRESULT DwmModifyPreviousDxFrameDuration(INT cRefreshes, BOOL fRelative)
{
if(!IsDwmSupported()) return E_NOTIMPL;
T* pT = static_cast<T*>(this);
ATLASSERT(::IsWindow(pT->m_hWnd));
return ::DwmModifyPreviousDxFrameDuration(pT->m_hWnd, cRefreshes, fRelative);
}
HRESULT DwmSetDxFrameDuration(INT cRefreshes)
{
if(!IsDwmSupported()) return E_NOTIMPL;
T* pT = static_cast<T*>(this);
ATLASSERT(::IsWindow(pT->m_hWnd));
return ::DwmSetDxFrameDuration(pT->m_hWnd, cRefreshes);
}
HRESULT DwmSetPresentParameters(DWM_PRESENT_PARAMETERS* pPresentParams)
{
if(!IsDwmSupported()) return E_NOTIMPL;
T* pT = static_cast<T*>(this);
ATLASSERT(::IsWindow(pT->m_hWnd));
return ::DwmSetPresentParameters(pT->m_hWnd, pPresentParams);
}
HRESULT DwmSetWindowAttribute(DWORD dwAttribute, LPCVOID pvAttribute, DWORD cbAttribute)
{
if(!IsDwmSupported()) return E_NOTIMPL;
T* pT = static_cast<T*>(this);
ATLASSERT(::IsWindow(pT->m_hWnd));
return ::DwmSetWindowAttribute(pT->m_hWnd, dwAttribute, pvAttribute, cbAttribute);
}
HRESULT DwmAttachMilContent()
{
if(!IsDwmSupported()) return E_NOTIMPL;
T* pT = static_cast<T*>(this);
ATLASSERT(::IsWindow(pT->m_hWnd));
return ::DwmAttachMilContent(pT->m_hWnd);
}
HRESULT DwmDetachMilContent()
{
if(!IsDwmSupported()) return E_NOTIMPL;
T* pT = static_cast<T*>(this);
ATLASSERT(::IsWindow(pT->m_hWnd));
return ::DwmDetachMilContent(pT->m_hWnd);
}
};
template <class TBase>
class CDwmWindowT : public TBase, public CDwmImpl<CDwmWindowT< TBase > >
{
public:
CDwmWindowT(HWND hWnd = NULL) : TBase(hWnd)
{ }
CDwmWindowT< TBase >& operator =(HWND hWnd)
{
m_hWnd = hWnd;
return *this;
}
};
typedef CDwmWindowT<ATL::CWindow> CDwmWindow;
///////////////////////////////////////////////////////////////////////////////
// CDwmThumbnail - provides DWM thumbnail support
template <bool t_bManaged, class TBase = CDwm>
class CDwmThumbnailT : public TBase
{
public:
// Data members
HTHUMBNAIL m_hThumbnail;
// Constructor
CDwmThumbnailT(HTHUMBNAIL hThumbnail = NULL) : m_hThumbnail(hThumbnail)
{
}
~CDwmThumbnailT()
{
if(t_bManaged && m_hThumbnail != NULL)
Unregister();
}
// Operations
CDwmThumbnailT<t_bManaged, TBase>& operator =(HTHUMBNAIL hThumbnail)
{
Attach(hThumbnail);
return *this;
}
void Attach(HTHUMBNAIL hThumbnailNew)
{
if(t_bManaged && m_hThumbnail != NULL && m_hThumbnail != hThumbnailNew)
Unregister();
m_hThumbnail = hThumbnailNew;
}
HTHUMBNAIL Detach()
{
HTHUMBNAIL hThumbnail = m_hThumbnail;
m_hThumbnail = NULL;
return hThumbnail;
}
HRESULT Register(HWND hwndDestination, HWND hwndSource)
{
ATLASSERT(::IsWindow(hwndDestination));
ATLASSERT(::IsWindow(hwndSource));
ATLASSERT(m_hThumbnail==NULL);
if(!IsDwmSupported()) return E_NOTIMPL;
return ::DwmRegisterThumbnail(hwndDestination, hwndSource, &m_hThumbnail);
}
HRESULT Unregister()
{
if(!IsDwmSupported()) return E_NOTIMPL;
if(m_hThumbnail == NULL) return S_FALSE;
HRESULT Hr = ::DwmUnregisterThumbnail(m_hThumbnail);
if(SUCCEEDED(Hr)) m_hThumbnail = NULL;
return Hr;
}
operator HTHUMBNAIL() const { return m_hThumbnail; }
bool IsNull() const { return (m_hThumbnail == NULL); }
HRESULT UpdateProperties(const DWM_THUMBNAIL_PROPERTIES* ptnProperties)
{
if(!IsDwmSupported()) return E_NOTIMPL;
ATLASSERT(m_hThumbnail != NULL);
return ::DwmUpdateThumbnailProperties(m_hThumbnail, ptnProperties);
}
// Attributes
HRESULT QuerySourceSize(PSIZE pSize)
{
if(!IsDwmSupported()) return E_NOTIMPL;
ATLASSERT(m_hThumbnail != NULL);
return ::DwmQueryThumbnailSourceSize(m_hThumbnail, pSize);
}
};
typedef CDwmThumbnailT<true, CDwm> CDwmThumbnail;
typedef CDwmThumbnailT<false, CDwm> CDwmThumbnailHandle;
#ifdef __ATLTHEME_H__
///////////////////////////////////////////////////////////////////////////////
// CAeroControlImpl - Base class for controls on Glass
template <class T, class TBase = ATL::CWindow, class TWinTraits = ATL::CControlWinTraits>
class CAeroControlImpl :
public CThemeImpl<T>,
public CBufferedPaintImpl<T>,
public ATL::CWindowImpl<T, TBase, TWinTraits>
{
public:
typedef CThemeImpl<T> _themeClass;
typedef CBufferedPaintImpl<T> _baseClass;
typedef ATL::CWindowImpl<T, TBase, TWinTraits> _windowClass;
CAeroControlImpl()
{
m_PaintParams.dwFlags = BPPF_ERASE;
}
static LPCWSTR GetThemeName()
{
#ifdef _UNICODE
return TBase::GetWndClassName();
#else
ATLASSERT(!_T("Return UNICODE string of window classname / theme class"));
return NULL;
#endif // _UNICODE
}
// Message map and handlers
BEGIN_MSG_MAP(CAeroControlImpl)
MESSAGE_HANDLER(WM_CREATE, OnCreate)
MESSAGE_HANDLER(WM_ACTIVATE, OnActivate)
CHAIN_MSG_MAP(_themeClass)
CHAIN_MSG_MAP(_baseClass)
END_MSG_MAP()
LRESULT OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)
{
T* pT = static_cast<T*>(this);
pT->Init();
bHandled = FALSE;
return 0;
}
LRESULT OnActivate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)
{
if(IsThemingSupported()) Invalidate(FALSE);
bHandled = FALSE;
return 0;
}
// Operations
BOOL SubclassWindow(HWND hWnd)
{
ATLASSERT(m_hWnd == NULL);
ATLASSERT(::IsWindow(hWnd));
BOOL bRet = _windowClass::SubclassWindow(hWnd);
if(bRet) {
T* pT = static_cast<T*>(this);
pT->Init();
}
return bRet;
}
// Implementation
LRESULT DefWindowProc()
{
const _ATL_MSG* pMsg = m_pCurrentMsg;
LRESULT lRes = 0;
if(pMsg != NULL)
lRes = DefWindowProc(pMsg->message, pMsg->wParam, pMsg->lParam);
return lRes;
}
LRESULT DefWindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
T* pT = static_cast<T*>(this);
LRESULT lRes = 0;
if( ::DwmDefWindowProc(pT->m_hWnd, uMsg, wParam, lParam, &lRes) ) return lRes;
return _windowClass::DefWindowProc(uMsg, wParam, lParam);
}
void DoBufferedPaint(HDC hDC, RECT& rcPaint)
{
T* pT = static_cast<T*>(this);
HDC hDCPaint = NULL;
RECT rcClient = { 0 };
GetClientRect(&rcClient);
m_BufferedPaint.Begin(hDC, &rcClient, m_dwFormat, &m_PaintParams, &hDCPaint);
ATLASSERT(hDCPaint != NULL);
pT->DoAeroPaint(hDCPaint, rcClient, rcPaint);
m_BufferedPaint.End();
}
void DoPaint(HDC /*hdc*/, RECT& /*rcClient*/)
{
DefWindowProc();
}
// Overridables
void Init()
{
T* pT = static_cast<T*>(this);
SetThemeClassList(pT->GetThemeName());
if(m_lpstrThemeClassList != NULL)
OpenThemeData();
}
void DoAeroPaint(HDC hDC, RECT& /*rcClient*/, RECT& rcPaint)
{
DefWindowProc(WM_PAINT, (WPARAM) hDC, 0L);
m_BufferedPaint.MakeOpaque(&rcPaint);
}
};
#endif // __ATLTHEME_H__
}; // namespace WTL
#endif // __ATLDWM_H__

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,263 +0,0 @@
// Windows Template Library - WTL version 8.1
// Copyright (C) Microsoft Corporation. All rights reserved.
//
// This file is a part of the Windows Template Library.
// The use and distribution terms for this software are covered by the
// Common Public License 1.0 (http://opensource.org/licenses/cpl1.0.php)
// which can be found in the file CPL.TXT at the root of this distribution.
// By using this software in any fashion, you are agreeing to be bound by
// the terms of this license. You must not remove this notice, or
// any other, from this software.
#ifndef __ATLRES_H__
#define __ATLRES_H__
#pragma once
#if defined(_WIN32_WCE) && !defined(__ATLRESCE_H__)
#error Use atlresCE.h instead of atlres.h for Windows CE
#endif
#ifdef RC_INVOKED
#ifndef _INC_WINDOWS
#define _INC_WINDOWS
#ifndef _WIN32_WCE
#define VS_VERSION_INFO 1
#ifdef APSTUDIO_INVOKED
#define APSTUDIO_HIDDEN_SYMBOLS // Ignore following symbols
#endif // APSTUDIO_INVOKED
#ifndef WINVER
#define WINVER 0x0400 // default to Windows Version 4.0
#endif // !WINVER
#include <winresrc.h>
// operation messages sent to DLGINIT
#define LB_ADDSTRING (WM_USER+1)
#define CB_ADDSTRING (WM_USER+3)
#endif // !_WIN32_WCE
#ifdef APSTUDIO_INVOKED
#undef APSTUDIO_HIDDEN_SYMBOLS
#endif // APSTUDIO_INVOKED
#ifdef IDC_STATIC
#undef IDC_STATIC
#endif // IDC_STATIC
#define IDC_STATIC (-1)
#endif // !_INC_WINDOWS
#endif // RC_INVOKED
#ifdef APSTUDIO_INVOKED
#define APSTUDIO_HIDDEN_SYMBOLS
#endif // APSTUDIO_INVOKED
///////////////////////////////////////////////////////////////////////////////
// ATL resource types
#ifndef RC_INVOKED
#define RT_DLGINIT MAKEINTRESOURCE(240)
#define RT_TOOLBAR MAKEINTRESOURCE(241)
#endif // RC_INVOKED
///////////////////////////////////////////////////////////////////////////////
#ifdef APSTUDIO_INVOKED
#undef APSTUDIO_HIDDEN_SYMBOLS
#endif // APSTUDIO_INVOKED
///////////////////////////////////////////////////////////////////////////////
// Standard window components
#define ID_SEPARATOR 0 // special separator value
#define ID_DEFAULT_PANE 0 // default status bar pane
#ifndef RC_INVOKED // code only
// standard control bars (IDW = window ID)
#define ATL_IDW_TOOLBAR 0xE800 // main Toolbar for window
#define ATL_IDW_STATUS_BAR 0xE801 // Status bar window
#define ATL_IDW_COMMAND_BAR 0xE802 // Command bar window
// parts of a frame window
#define ATL_IDW_CLIENT 0xE900
#define ATL_IDW_PANE_FIRST 0xE900 // first pane (256 max)
#define ATL_IDW_PANE_LAST 0xE9FF
#define ATL_IDW_HSCROLL_FIRST 0xEA00 // first Horz scrollbar (16 max)
#define ATL_IDW_VSCROLL_FIRST 0xEA10 // first Vert scrollbar (16 max)
#define ATL_IDW_SIZE_BOX 0xEA20 // size box for splitters
#define ATL_IDW_PANE_SAVE 0xEA21 // to shift ATL_IDW_PANE_FIRST
// bands for a rebar
#define ATL_IDW_BAND_FIRST 0xEB00
#define ATL_IDW_BAND_LAST 0xEBFF
#endif // !RC_INVOKED
///////////////////////////////////////////////////////////////////////////////
// Standard Commands
// File commands
#define ID_FILE_NEW 0xE100
#define ID_FILE_OPEN 0xE101
#define ID_FILE_CLOSE 0xE102
#define ID_FILE_SAVE 0xE103
#define ID_FILE_SAVE_AS 0xE104
#define ID_FILE_PAGE_SETUP 0xE105
#define ID_FILE_PRINT_SETUP 0xE106
#define ID_FILE_PRINT 0xE107
#define ID_FILE_PRINT_DIRECT 0xE108
#define ID_FILE_PRINT_PREVIEW 0xE109
#define ID_FILE_UPDATE 0xE10A
#define ID_FILE_SAVE_COPY_AS 0xE10B
#define ID_FILE_SEND_MAIL 0xE10C
#define ID_FILE_MRU_FIRST 0xE110
#define ID_FILE_MRU_FILE1 0xE110 // range - 16 max
#define ID_FILE_MRU_FILE2 0xE111
#define ID_FILE_MRU_FILE3 0xE112
#define ID_FILE_MRU_FILE4 0xE113
#define ID_FILE_MRU_FILE5 0xE114
#define ID_FILE_MRU_FILE6 0xE115
#define ID_FILE_MRU_FILE7 0xE116
#define ID_FILE_MRU_FILE8 0xE117
#define ID_FILE_MRU_FILE9 0xE118
#define ID_FILE_MRU_FILE10 0xE119
#define ID_FILE_MRU_FILE11 0xE11A
#define ID_FILE_MRU_FILE12 0xE11B
#define ID_FILE_MRU_FILE13 0xE11C
#define ID_FILE_MRU_FILE14 0xE11D
#define ID_FILE_MRU_FILE15 0xE11E
#define ID_FILE_MRU_FILE16 0xE11F
#define ID_FILE_MRU_LAST 0xE11F
// Edit commands
#define ID_EDIT_CLEAR 0xE120
#define ID_EDIT_CLEAR_ALL 0xE121
#define ID_EDIT_COPY 0xE122
#define ID_EDIT_CUT 0xE123
#define ID_EDIT_FIND 0xE124
#define ID_EDIT_PASTE 0xE125
#define ID_EDIT_PASTE_LINK 0xE126
#define ID_EDIT_PASTE_SPECIAL 0xE127
#define ID_EDIT_REPEAT 0xE128
#define ID_EDIT_REPLACE 0xE129
#define ID_EDIT_SELECT_ALL 0xE12A
#define ID_EDIT_UNDO 0xE12B
#define ID_EDIT_REDO 0xE12C
// Window commands
#define ID_WINDOW_NEW 0xE130
#define ID_WINDOW_ARRANGE 0xE131
#define ID_WINDOW_CASCADE 0xE132
#define ID_WINDOW_TILE_HORZ 0xE133
#define ID_WINDOW_TILE_VERT 0xE134
#define ID_WINDOW_SPLIT 0xE135
#ifndef RC_INVOKED // code only
#define ATL_IDM_WINDOW_FIRST 0xE130
#define ATL_IDM_WINDOW_LAST 0xE13F
#define ATL_IDM_FIRST_MDICHILD 0xFF00 // window list starts here
#define ATL_IDM_LAST_MDICHILD 0xFFFD
#endif // !RC_INVOKED
// TabView
#define ID_WINDOW_TABFIRST 0xFF00 // = ATL_IDM_FIRST_MDICHILD
#define ID_WINDOW_TABLAST 0xFFFD
#define ID_WINDOW_SHOWTABLIST 0xFFFE
// Help and App commands
#define ID_APP_ABOUT 0xE140
#define ID_APP_EXIT 0xE141
#define ID_HELP_INDEX 0xE142
#define ID_HELP_FINDER 0xE143
#define ID_HELP_USING 0xE144
#define ID_CONTEXT_HELP 0xE145 // shift-F1
// special commands for processing help
#define ID_HELP 0xE146 // first attempt for F1
#define ID_DEFAULT_HELP 0xE147 // last attempt
// Misc
#define ID_NEXT_PANE 0xE150
#define ID_PREV_PANE 0xE151
#define ID_PANE_CLOSE 0xE152
// Format
#define ID_FORMAT_FONT 0xE160
// Scroll
#define ID_SCROLL_UP 0xE170
#define ID_SCROLL_DOWN 0xE171
#define ID_SCROLL_PAGE_UP 0xE172
#define ID_SCROLL_PAGE_DOWN 0xE173
#define ID_SCROLL_TOP 0xE174
#define ID_SCROLL_BOTTOM 0xE175
#define ID_SCROLL_LEFT 0xE176
#define ID_SCROLL_RIGHT 0xE177
#define ID_SCROLL_PAGE_LEFT 0xE178
#define ID_SCROLL_PAGE_RIGHT 0xE179
#define ID_SCROLL_ALL_LEFT 0xE17A
#define ID_SCROLL_ALL_RIGHT 0xE17B
// OLE commands
#define ID_OLE_INSERT_NEW 0xE200
#define ID_OLE_EDIT_LINKS 0xE201
#define ID_OLE_EDIT_CONVERT 0xE202
#define ID_OLE_EDIT_CHANGE_ICON 0xE203
#define ID_OLE_EDIT_PROPERTIES 0xE204
#define ID_OLE_VERB_FIRST 0xE210 // range - 16 max
#ifndef RC_INVOKED // code only
#define ID_OLE_VERB_LAST 0xE21F
#endif // !RC_INVOKED
// View commands (same number used as IDW used for toolbar and status bar)
#define ID_VIEW_TOOLBAR 0xE800
#define ID_VIEW_STATUS_BAR 0xE801
#define ID_VIEW_REFRESH 0xE803
#define ID_VIEW_RIBBON 0xE804 // Ribbon
///////////////////////////////////////////////////////////////////////////////
// Standard control IDs
#ifdef IDC_STATIC
#undef IDC_STATIC
#endif // IDC_STATIC
#define IDC_STATIC (-1) // all static controls
///////////////////////////////////////////////////////////////////////////////
// Standard string error/warnings
// idle status bar message
#define ATL_IDS_IDLEMESSAGE 0xE001
#ifndef RC_INVOKED // code only
#define ATL_IDS_SCFIRST 0xEF00
#endif // !RC_INVOKED
#define ATL_IDS_SCSIZE 0xEF00
#define ATL_IDS_SCMOVE 0xEF01
#define ATL_IDS_SCMINIMIZE 0xEF02
#define ATL_IDS_SCMAXIMIZE 0xEF03
#define ATL_IDS_SCNEXTWINDOW 0xEF04
#define ATL_IDS_SCPREVWINDOW 0xEF05
#define ATL_IDS_SCCLOSE 0xEF06
#define ATL_IDS_SCRESTORE 0xEF12
#define ATL_IDS_SCTASKLIST 0xEF13
#define ATL_IDS_MDICHILD 0xEF1F
#define ATL_IDS_MRU_FILE 0xEFDA
///////////////////////////////////////////////////////////////////////////////
// Misc. control IDs
// Property Sheet control id's (determined with Spy++)
#define ID_APPLY_NOW 0x3021
#define ID_WIZBACK 0x3023
#define ID_WIZNEXT 0x3024
#define ID_WIZFINISH 0x3025
#define ATL_IDC_TAB_CONTROL 0x3020
#endif // __ATLRES_H__

View File

@ -1,93 +0,0 @@
// Windows Template Library - WTL version 8.1
// Copyright (C) Microsoft Corporation. All rights reserved.
//
// This file is a part of the Windows Template Library.
// The use and distribution terms for this software are covered by the
// Common Public License 1.0 (http://opensource.org/licenses/cpl1.0.php)
// which can be found in the file CPL.TXT at the root of this distribution.
// By using this software in any fashion, you are agreeing to be bound by
// the terms of this license. You must not remove this notice, or
// any other, from this software.
#ifndef __ATLRESCE_H__
#define __ATLRESCE_H__
#pragma once
#ifndef _WIN32_WCE
#error atlresCE.h is only for Windows CE
#endif
#ifdef RC_INVOKED
#ifndef _INC_WINDOWS
#define VS_VERSION_INFO 1
#ifdef APSTUDIO_INVOKED
#define APSTUDIO_HIDDEN_SYMBOLS // Ignore following symbols
#endif // APSTUDIO_INVOKED
#ifndef WINVER
#define WINVER 0x0400 // default to Windows Version 4.0
#endif // !WINVER
#if !defined(WCEOLE_ENABLE_DIALOGEX)
#define DIALOGEX DIALOG DISCARDABLE
#endif
#include <commctrl.h>
#define SHMENUBAR RCDATA
#if defined(SHELLSDK_MODULES_AYGSHELL)
#include <aygshell.h>
#else
#define NOMENU 0xFFFF
#define IDS_SHNEW 1
#define IDM_SHAREDNEW 10
#define IDM_SHAREDNEWDEFAULT 11
#endif
#ifndef I_IMAGENONE
#define I_IMAGENONE (-2)
#endif
#include <windows.h>
#endif // !_INC_WINDOWS
#endif // RC_INVOKED
#include "atlres.h"
#ifdef APSTUDIO_INVOKED
#undef APSTUDIO_HIDDEN_SYMBOLS
#endif // APSTUDIO_INVOKED
// Visual Studio dialog editor bug fix
#ifndef DS_FIXEDSYS
#define DS_FIXEDSYS 0
#endif
#define IDC_INFOSTATIC 0xFFFE // == IDC_STATIC -1
///////////////////////////////////////////////////////////////////////////////
// Smartphone and PPC 2005 Resource IDs
// Command and associated string resource IDs
#define ID_MENU_OK 0xE790
#define ID_MENU_CANCEL 0xE791
#define ID_MENU 0xE792
#define ID_ACTION 0xE793
#define ID_VIEW_FULLSCREEN 0xE802
// MenuBar resource IDs
#define ATL_IDM_MENU_DONE 0xE701
#define ATL_IDM_MENU_CANCEL 0xE702
#define ATL_IDM_MENU_DONECANCEL 0xE703
// Default device MenuBar control ID and MenuBar resource ID
#define ATL_IDW_MENU_BAR 0xE802
// SmartPhone spinned controls ID offset for CSpinCtrl
#define ATL_IDW_SPIN_ID 9999
#endif // __ATLRESCE_H__

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,917 +0,0 @@
// Windows Template Library - WTL version 8.1
// Copyright (C) Microsoft Corporation. All rights reserved.
//
// This file is a part of the Windows Template Library.
// The use and distribution terms for this software are covered by the
// Common Public License 1.0 (http://opensource.org/licenses/cpl1.0.php)
// which can be found in the file CPL.TXT at the root of this distribution.
// By using this software in any fashion, you are agreeing to be bound by
// the terms of this license. You must not remove this notice, or
// any other, from this software.
#ifndef __ATLSPLIT_H__
#define __ATLSPLIT_H__
#pragma once
#ifndef __ATLAPP_H__
#error atlsplit.h requires atlapp.h to be included first
#endif
#ifndef __ATLWIN_H__
#error atlsplit.h requires atlwin.h to be included first
#endif
///////////////////////////////////////////////////////////////////////////////
// Classes in this file:
//
// CSplitterImpl<T, t_bVertical>
// CSplitterWindowImpl<T, t_bVertical, TBase, TWinTraits>
// CSplitterWindowT<t_bVertical>
namespace WTL
{
///////////////////////////////////////////////////////////////////////////////
// CSplitterImpl - Provides splitter support to any window
// Splitter panes constants
#define SPLIT_PANE_LEFT 0
#define SPLIT_PANE_RIGHT 1
#define SPLIT_PANE_TOP SPLIT_PANE_LEFT
#define SPLIT_PANE_BOTTOM SPLIT_PANE_RIGHT
#define SPLIT_PANE_NONE -1
// Splitter extended styles
#define SPLIT_PROPORTIONAL 0x00000001
#define SPLIT_NONINTERACTIVE 0x00000002
#define SPLIT_RIGHTALIGNED 0x00000004
#define SPLIT_BOTTOMALIGNED SPLIT_RIGHTALIGNED
#define SPLIT_GRADIENTBAR 0x00000008
#define SPLIT_FIXEDBARSIZE 0x00000010
// Note: SPLIT_PROPORTIONAL and SPLIT_RIGHTALIGNED/SPLIT_BOTTOMALIGNED are
// mutually exclusive. If both are set, splitter defaults to SPLIT_PROPORTIONAL
template <class T, bool t_bVertical = true>
class CSplitterImpl
{
public:
enum { m_nPanesCount = 2, m_nPropMax = 10000 };
HWND m_hWndPane[m_nPanesCount];
RECT m_rcSplitter;
int m_xySplitterPos;
int m_nDefActivePane;
int m_cxySplitBar; // splitter bar width/height
static HCURSOR m_hCursor;
int m_cxyMin; // minimum pane size
int m_cxyBarEdge; // splitter bar edge
bool m_bFullDrag;
int m_cxyDragOffset;
int m_nProportionalPos;
bool m_bUpdateProportionalPos;
DWORD m_dwExtendedStyle; // splitter specific extended styles
int m_nSinglePane; // single pane mode
// Constructor
CSplitterImpl() :
m_xySplitterPos(-1), m_nDefActivePane(SPLIT_PANE_NONE),
m_cxySplitBar(4), m_cxyMin(0), m_cxyBarEdge(0), m_bFullDrag(true),
m_cxyDragOffset(0), m_nProportionalPos(0), m_bUpdateProportionalPos(true),
m_dwExtendedStyle(SPLIT_PROPORTIONAL),
m_nSinglePane(SPLIT_PANE_NONE)
{
m_hWndPane[SPLIT_PANE_LEFT] = NULL;
m_hWndPane[SPLIT_PANE_RIGHT] = NULL;
::SetRectEmpty(&m_rcSplitter);
if(m_hCursor == NULL)
{
CStaticDataInitCriticalSectionLock lock;
if(FAILED(lock.Lock()))
{
ATLTRACE2(atlTraceUI, 0, _T("ERROR : Unable to lock critical section in CSplitterImpl::CSplitterImpl.\n"));
ATLASSERT(FALSE);
return;
}
if(m_hCursor == NULL)
m_hCursor = ::LoadCursor(NULL, t_bVertical ? IDC_SIZEWE : IDC_SIZENS);
lock.Unlock();
}
}
// Attributes
void SetSplitterRect(LPRECT lpRect = NULL, bool bUpdate = true)
{
if(lpRect == NULL)
{
T* pT = static_cast<T*>(this);
pT->GetClientRect(&m_rcSplitter);
}
else
{
m_rcSplitter = *lpRect;
}
if(IsProportional())
UpdateProportionalPos();
else if(IsRightAligned())
UpdateRightAlignPos();
if(bUpdate)
UpdateSplitterLayout();
}
void GetSplitterRect(LPRECT lpRect) const
{
ATLASSERT(lpRect != NULL);
*lpRect = m_rcSplitter;
}
bool SetSplitterPos(int xyPos = -1, bool bUpdate = true)
{
if(xyPos == -1) // -1 == middle
{
if(t_bVertical)
xyPos = (m_rcSplitter.right - m_rcSplitter.left - m_cxySplitBar - m_cxyBarEdge) / 2;
else
xyPos = (m_rcSplitter.bottom - m_rcSplitter.top - m_cxySplitBar - m_cxyBarEdge) / 2;
}
// Adjust if out of valid range
int cxyMax = 0;
if(t_bVertical)
cxyMax = m_rcSplitter.right - m_rcSplitter.left;
else
cxyMax = m_rcSplitter.bottom - m_rcSplitter.top;
if(xyPos < m_cxyMin + m_cxyBarEdge)
xyPos = m_cxyMin;
else if(xyPos > (cxyMax - m_cxySplitBar - m_cxyBarEdge - m_cxyMin))
xyPos = cxyMax - m_cxySplitBar - m_cxyBarEdge - m_cxyMin;
// Set new position and update if requested
bool bRet = (m_xySplitterPos != xyPos);
m_xySplitterPos = xyPos;
if(m_bUpdateProportionalPos)
{
if(IsProportional())
StoreProportionalPos();
else if(IsRightAligned())
StoreRightAlignPos();
}
else
{
m_bUpdateProportionalPos = true;
}
if(bUpdate && bRet)
UpdateSplitterLayout();
return bRet;
}
void SetSplitterPosPct(int nPct, bool bUpdate = true)
{
ATLASSERT(nPct >= 0 && nPct <= 100);
m_nProportionalPos = ::MulDiv(nPct, m_nPropMax, 100);
UpdateProportionalPos();
if(bUpdate)
UpdateSplitterLayout();
}
int GetSplitterPos() const
{
return m_xySplitterPos;
}
bool SetSinglePaneMode(int nPane = SPLIT_PANE_NONE)
{
ATLASSERT(nPane == SPLIT_PANE_LEFT || nPane == SPLIT_PANE_RIGHT || nPane == SPLIT_PANE_NONE);
if(!(nPane == SPLIT_PANE_LEFT || nPane == SPLIT_PANE_RIGHT || nPane == SPLIT_PANE_NONE))
return false;
if(nPane != SPLIT_PANE_NONE)
{
if(!::IsWindowVisible(m_hWndPane[nPane]))
::ShowWindow(m_hWndPane[nPane], SW_SHOW);
int nOtherPane = (nPane == SPLIT_PANE_LEFT) ? SPLIT_PANE_RIGHT : SPLIT_PANE_LEFT;
::ShowWindow(m_hWndPane[nOtherPane], SW_HIDE);
if(m_nDefActivePane != nPane)
m_nDefActivePane = nPane;
}
else if(m_nSinglePane != SPLIT_PANE_NONE)
{
int nOtherPane = (m_nSinglePane == SPLIT_PANE_LEFT) ? SPLIT_PANE_RIGHT : SPLIT_PANE_LEFT;
::ShowWindow(m_hWndPane[nOtherPane], SW_SHOW);
}
m_nSinglePane = nPane;
UpdateSplitterLayout();
return true;
}
int GetSinglePaneMode() const
{
return m_nSinglePane;
}
DWORD GetSplitterExtendedStyle() const
{
return m_dwExtendedStyle;
}
DWORD SetSplitterExtendedStyle(DWORD dwExtendedStyle, DWORD dwMask = 0)
{
DWORD dwPrevStyle = m_dwExtendedStyle;
if(dwMask == 0)
m_dwExtendedStyle = dwExtendedStyle;
else
m_dwExtendedStyle = (m_dwExtendedStyle & ~dwMask) | (dwExtendedStyle & dwMask);
#ifdef _DEBUG
if(IsProportional() && IsRightAligned())
ATLTRACE2(atlTraceUI, 0, _T("CSplitterImpl::SetSplitterExtendedStyle - SPLIT_PROPORTIONAL and SPLIT_RIGHTALIGNED are mutually exclusive, defaulting to SPLIT_PROPORTIONAL.\n"));
#endif // _DEBUG
return dwPrevStyle;
}
// Splitter operations
void SetSplitterPanes(HWND hWndLeftTop, HWND hWndRightBottom, bool bUpdate = true)
{
m_hWndPane[SPLIT_PANE_LEFT] = hWndLeftTop;
m_hWndPane[SPLIT_PANE_RIGHT] = hWndRightBottom;
ATLASSERT(m_hWndPane[SPLIT_PANE_LEFT] == NULL || m_hWndPane[SPLIT_PANE_RIGHT] == NULL || m_hWndPane[SPLIT_PANE_LEFT] != m_hWndPane[SPLIT_PANE_RIGHT]);
if(bUpdate)
UpdateSplitterLayout();
}
bool SetSplitterPane(int nPane, HWND hWnd, bool bUpdate = true)
{
ATLASSERT(nPane == SPLIT_PANE_LEFT || nPane == SPLIT_PANE_RIGHT);
if(nPane != SPLIT_PANE_LEFT && nPane != SPLIT_PANE_RIGHT)
return false;
m_hWndPane[nPane] = hWnd;
ATLASSERT(m_hWndPane[SPLIT_PANE_LEFT] == NULL || m_hWndPane[SPLIT_PANE_RIGHT] == NULL || m_hWndPane[SPLIT_PANE_LEFT] != m_hWndPane[SPLIT_PANE_RIGHT]);
if(bUpdate)
UpdateSplitterLayout();
return true;
}
HWND GetSplitterPane(int nPane) const
{
ATLASSERT(nPane == SPLIT_PANE_LEFT || nPane == SPLIT_PANE_RIGHT);
if(nPane != SPLIT_PANE_LEFT && nPane != SPLIT_PANE_RIGHT)
return false;
return m_hWndPane[nPane];
}
bool SetActivePane(int nPane)
{
ATLASSERT(nPane == SPLIT_PANE_LEFT || nPane == SPLIT_PANE_RIGHT);
if(nPane != SPLIT_PANE_LEFT && nPane != SPLIT_PANE_RIGHT)
return false;
if(m_nSinglePane != SPLIT_PANE_NONE && nPane != m_nSinglePane)
return false;
::SetFocus(m_hWndPane[nPane]);
m_nDefActivePane = nPane;
return true;
}
int GetActivePane() const
{
int nRet = SPLIT_PANE_NONE;
HWND hWndFocus = ::GetFocus();
if(hWndFocus != NULL)
{
for(int nPane = 0; nPane < m_nPanesCount; nPane++)
{
if(hWndFocus == m_hWndPane[nPane] || ::IsChild(m_hWndPane[nPane], hWndFocus))
{
nRet = nPane;
break;
}
}
}
return nRet;
}
bool ActivateNextPane(bool bNext = true)
{
int nPane = m_nSinglePane;
if(nPane == SPLIT_PANE_NONE)
{
switch(GetActivePane())
{
case SPLIT_PANE_LEFT:
nPane = SPLIT_PANE_RIGHT;
break;
case SPLIT_PANE_RIGHT:
nPane = SPLIT_PANE_LEFT;
break;
default:
nPane = bNext ? SPLIT_PANE_LEFT : SPLIT_PANE_RIGHT;
break;
}
}
return SetActivePane(nPane);
}
bool SetDefaultActivePane(int nPane)
{
ATLASSERT(nPane == SPLIT_PANE_LEFT || nPane == SPLIT_PANE_RIGHT);
if(nPane != SPLIT_PANE_LEFT && nPane != SPLIT_PANE_RIGHT)
return false;
m_nDefActivePane = nPane;
return true;
}
bool SetDefaultActivePane(HWND hWnd)
{
for(int nPane = 0; nPane < m_nPanesCount; nPane++)
{
if(hWnd == m_hWndPane[nPane])
{
m_nDefActivePane = nPane;
return true;
}
}
return false; // not found
}
int GetDefaultActivePane() const
{
return m_nDefActivePane;
}
void DrawSplitter(CDCHandle dc)
{
ATLASSERT(dc.m_hDC != NULL);
if(m_nSinglePane == SPLIT_PANE_NONE && m_xySplitterPos == -1)
return;
T* pT = static_cast<T*>(this);
if(m_nSinglePane == SPLIT_PANE_NONE)
{
pT->DrawSplitterBar(dc);
for(int nPane = 0; nPane < m_nPanesCount; nPane++)
{
if(m_hWndPane[nPane] == NULL)
pT->DrawSplitterPane(dc, nPane);
}
}
else
{
if(m_hWndPane[m_nSinglePane] == NULL)
pT->DrawSplitterPane(dc, m_nSinglePane);
}
}
// Overrideables
void DrawSplitterBar(CDCHandle dc)
{
RECT rect = { 0 };
if(GetSplitterBarRect(&rect))
{
dc.FillRect(&rect, COLOR_3DFACE);
#if (!defined(_WIN32_WCE) || (_WIN32_WCE >= 420))
if((m_dwExtendedStyle & SPLIT_GRADIENTBAR) != 0)
{
RECT rect2 = rect;
if(t_bVertical)
rect2.left = (rect.left + rect.right) / 2 - 1;
else
rect2.top = (rect.top + rect.bottom) / 2 - 1;
dc.GradientFillRect(rect2, ::GetSysColor(COLOR_3DFACE), ::GetSysColor(COLOR_3DSHADOW), t_bVertical);
}
#endif // !defined(_WIN32_WCE) || (_WIN32_WCE >= 420)
// draw 3D edge if needed
T* pT = static_cast<T*>(this);
if((pT->GetExStyle() & WS_EX_CLIENTEDGE) != 0)
dc.DrawEdge(&rect, EDGE_RAISED, t_bVertical ? (BF_LEFT | BF_RIGHT) : (BF_TOP | BF_BOTTOM));
}
}
// called only if pane is empty
void DrawSplitterPane(CDCHandle dc, int nPane)
{
RECT rect = { 0 };
if(GetSplitterPaneRect(nPane, &rect))
{
T* pT = static_cast<T*>(this);
if((pT->GetExStyle() & WS_EX_CLIENTEDGE) == 0)
dc.DrawEdge(&rect, EDGE_SUNKEN, BF_RECT | BF_ADJUST);
dc.FillRect(&rect, COLOR_APPWORKSPACE);
}
}
// Message map and handlers
BEGIN_MSG_MAP(CSplitterImpl)
MESSAGE_HANDLER(WM_CREATE, OnCreate)
MESSAGE_HANDLER(WM_PAINT, OnPaint)
#ifndef _WIN32_WCE
MESSAGE_HANDLER(WM_PRINTCLIENT, OnPaint)
#endif // !_WIN32_WCE
if(IsInteractive())
{
MESSAGE_HANDLER(WM_SETCURSOR, OnSetCursor)
MESSAGE_HANDLER(WM_MOUSEMOVE, OnMouseMove)
MESSAGE_HANDLER(WM_LBUTTONDOWN, OnLButtonDown)
MESSAGE_HANDLER(WM_LBUTTONUP, OnLButtonUp)
MESSAGE_HANDLER(WM_LBUTTONDBLCLK, OnLButtonDoubleClick)
MESSAGE_HANDLER(WM_CAPTURECHANGED, OnCaptureChanged)
}
MESSAGE_HANDLER(WM_SETFOCUS, OnSetFocus)
#ifndef _WIN32_WCE
MESSAGE_HANDLER(WM_MOUSEACTIVATE, OnMouseActivate)
#endif // !_WIN32_WCE
MESSAGE_HANDLER(WM_SETTINGCHANGE, OnSettingChange)
END_MSG_MAP()
LRESULT OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)
{
T* pT = static_cast<T*>(this);
pT->GetSystemSettings(false);
bHandled = FALSE;
return 1;
}
LRESULT OnPaint(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
T* pT = static_cast<T*>(this);
// try setting position if not set
if(m_nSinglePane == SPLIT_PANE_NONE && m_xySplitterPos == -1)
pT->SetSplitterPos();
// do painting
CPaintDC dc(pT->m_hWnd);
pT->DrawSplitter(dc.m_hDC);
return 0;
}
LRESULT OnSetCursor(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
T* pT = static_cast<T*>(this);
if((HWND)wParam == pT->m_hWnd && LOWORD(lParam) == HTCLIENT)
{
DWORD dwPos = ::GetMessagePos();
POINT ptPos = { GET_X_LPARAM(dwPos), GET_Y_LPARAM(dwPos) };
pT->ScreenToClient(&ptPos);
if(IsOverSplitterBar(ptPos.x, ptPos.y))
return 1;
}
bHandled = FALSE;
return 0;
}
LRESULT OnMouseMove(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
T* pT = static_cast<T*>(this);
int xPos = GET_X_LPARAM(lParam);
int yPos = GET_Y_LPARAM(lParam);
if((wParam & MK_LBUTTON) && ::GetCapture() == pT->m_hWnd)
{
int xyNewSplitPos = 0;
if(t_bVertical)
xyNewSplitPos = xPos - m_rcSplitter.left - m_cxyDragOffset;
else
xyNewSplitPos = yPos - m_rcSplitter.top - m_cxyDragOffset;
if(xyNewSplitPos == -1) // avoid -1, that means middle
xyNewSplitPos = -2;
if(m_xySplitterPos != xyNewSplitPos)
{
if(m_bFullDrag)
{
if(pT->SetSplitterPos(xyNewSplitPos, true))
pT->UpdateWindow();
}
else
{
DrawGhostBar();
pT->SetSplitterPos(xyNewSplitPos, false);
DrawGhostBar();
}
}
}
else // not dragging, just set cursor
{
if(IsOverSplitterBar(xPos, yPos))
::SetCursor(m_hCursor);
bHandled = FALSE;
}
return 0;
}
LRESULT OnLButtonDown(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& bHandled)
{
int xPos = GET_X_LPARAM(lParam);
int yPos = GET_Y_LPARAM(lParam);
if(IsOverSplitterBar(xPos, yPos))
{
T* pT = static_cast<T*>(this);
pT->SetCapture();
::SetCursor(m_hCursor);
if(!m_bFullDrag)
DrawGhostBar();
if(t_bVertical)
m_cxyDragOffset = xPos - m_rcSplitter.left - m_xySplitterPos;
else
m_cxyDragOffset = yPos - m_rcSplitter.top - m_xySplitterPos;
}
bHandled = FALSE;
return 1;
}
LRESULT OnLButtonUp(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)
{
::ReleaseCapture();
bHandled = FALSE;
return 1;
}
LRESULT OnLButtonDoubleClick(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
T* pT = static_cast<T*>(this);
pT->SetSplitterPos(); // middle
return 0;
}
LRESULT OnCaptureChanged(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
if(!m_bFullDrag)
{
DrawGhostBar();
UpdateSplitterLayout();
T* pT = static_cast<T*>(this);
pT->UpdateWindow();
}
return 0;
}
LRESULT OnSetFocus(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM, BOOL& bHandled)
{
if(m_nSinglePane == SPLIT_PANE_NONE)
{
if(m_nDefActivePane == SPLIT_PANE_LEFT || m_nDefActivePane == SPLIT_PANE_RIGHT)
::SetFocus(m_hWndPane[m_nDefActivePane]);
}
else
{
::SetFocus(m_hWndPane[m_nSinglePane]);
}
bHandled = FALSE;
return 1;
}
#ifndef _WIN32_WCE
LRESULT OnMouseActivate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)
{
T* pT = static_cast<T*>(this);
LRESULT lRet = pT->DefWindowProc(uMsg, wParam, lParam);
if(lRet == MA_ACTIVATE || lRet == MA_ACTIVATEANDEAT)
{
DWORD dwPos = ::GetMessagePos();
POINT pt = { GET_X_LPARAM(dwPos), GET_Y_LPARAM(dwPos) };
pT->ScreenToClient(&pt);
RECT rcPane = { 0 };
for(int nPane = 0; nPane < m_nPanesCount; nPane++)
{
if(GetSplitterPaneRect(nPane, &rcPane) && ::PtInRect(&rcPane, pt))
{
m_nDefActivePane = nPane;
break;
}
}
}
return lRet;
}
#endif // !_WIN32_WCE
LRESULT OnSettingChange(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
T* pT = static_cast<T*>(this);
pT->GetSystemSettings(true);
return 0;
}
// Implementation - internal helpers
void UpdateSplitterLayout()
{
if(m_nSinglePane == SPLIT_PANE_NONE && m_xySplitterPos == -1)
return;
T* pT = static_cast<T*>(this);
RECT rect = { 0 };
if(m_nSinglePane == SPLIT_PANE_NONE)
{
if(GetSplitterBarRect(&rect))
pT->InvalidateRect(&rect);
for(int nPane = 0; nPane < m_nPanesCount; nPane++)
{
if(GetSplitterPaneRect(nPane, &rect))
{
if(m_hWndPane[nPane] != NULL)
::SetWindowPos(m_hWndPane[nPane], NULL, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, SWP_NOZORDER);
else
pT->InvalidateRect(&rect);
}
}
}
else
{
if(GetSplitterPaneRect(m_nSinglePane, &rect))
{
if(m_hWndPane[m_nSinglePane] != NULL)
::SetWindowPos(m_hWndPane[m_nSinglePane], NULL, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, SWP_NOZORDER);
else
pT->InvalidateRect(&rect);
}
}
}
bool GetSplitterBarRect(LPRECT lpRect) const
{
ATLASSERT(lpRect != NULL);
if(m_nSinglePane != SPLIT_PANE_NONE || m_xySplitterPos == -1)
return false;
if(t_bVertical)
{
lpRect->left = m_rcSplitter.left + m_xySplitterPos;
lpRect->top = m_rcSplitter.top;
lpRect->right = m_rcSplitter.left + m_xySplitterPos + m_cxySplitBar + m_cxyBarEdge;
lpRect->bottom = m_rcSplitter.bottom;
}
else
{
lpRect->left = m_rcSplitter.left;
lpRect->top = m_rcSplitter.top + m_xySplitterPos;
lpRect->right = m_rcSplitter.right;
lpRect->bottom = m_rcSplitter.top + m_xySplitterPos + m_cxySplitBar + m_cxyBarEdge;
}
return true;
}
bool GetSplitterPaneRect(int nPane, LPRECT lpRect) const
{
ATLASSERT(nPane == SPLIT_PANE_LEFT || nPane == SPLIT_PANE_RIGHT);
ATLASSERT(lpRect != NULL);
bool bRet = true;
if(m_nSinglePane != SPLIT_PANE_NONE)
{
if(nPane == m_nSinglePane)
*lpRect = m_rcSplitter;
else
bRet = false;
}
else if(nPane == SPLIT_PANE_LEFT)
{
if(t_bVertical)
{
lpRect->left = m_rcSplitter.left;
lpRect->top = m_rcSplitter.top;
lpRect->right = m_rcSplitter.left + m_xySplitterPos;
lpRect->bottom = m_rcSplitter.bottom;
}
else
{
lpRect->left = m_rcSplitter.left;
lpRect->top = m_rcSplitter.top;
lpRect->right = m_rcSplitter.right;
lpRect->bottom = m_rcSplitter.top + m_xySplitterPos;
}
}
else if(nPane == SPLIT_PANE_RIGHT)
{
if(t_bVertical)
{
lpRect->left = m_rcSplitter.left + m_xySplitterPos + m_cxySplitBar + m_cxyBarEdge;
lpRect->top = m_rcSplitter.top;
lpRect->right = m_rcSplitter.right;
lpRect->bottom = m_rcSplitter.bottom;
}
else
{
lpRect->left = m_rcSplitter.left;
lpRect->top = m_rcSplitter.top + m_xySplitterPos + m_cxySplitBar + m_cxyBarEdge;
lpRect->right = m_rcSplitter.right;
lpRect->bottom = m_rcSplitter.bottom;
}
}
else
{
bRet = false;
}
return bRet;
}
bool IsOverSplitterRect(int x, int y) const
{
// -1 == don't check
return ((x == -1 || (x >= m_rcSplitter.left && x <= m_rcSplitter.right)) &&
(y == -1 || (y >= m_rcSplitter.top && y <= m_rcSplitter.bottom)));
}
bool IsOverSplitterBar(int x, int y) const
{
if(m_nSinglePane != SPLIT_PANE_NONE)
return false;
if(m_xySplitterPos == -1 || !IsOverSplitterRect(x, y))
return false;
int xy = t_bVertical ? x : y;
int xyOff = t_bVertical ? m_rcSplitter.left : m_rcSplitter.top;
return ((xy >= (xyOff + m_xySplitterPos)) && (xy < xyOff + m_xySplitterPos + m_cxySplitBar + m_cxyBarEdge));
}
void DrawGhostBar()
{
RECT rect = { 0 };
if(GetSplitterBarRect(&rect))
{
// convert client to window coordinates
T* pT = static_cast<T*>(this);
RECT rcWnd = { 0 };
pT->GetWindowRect(&rcWnd);
::MapWindowPoints(NULL, pT->m_hWnd, (LPPOINT)&rcWnd, 2);
::OffsetRect(&rect, -rcWnd.left, -rcWnd.top);
// invert the brush pattern (looks just like frame window sizing)
CWindowDC dc(pT->m_hWnd);
CBrush brush = CDCHandle::GetHalftoneBrush();
if(brush.m_hBrush != NULL)
{
CBrushHandle brushOld = dc.SelectBrush(brush);
dc.PatBlt(rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, PATINVERT);
dc.SelectBrush(brushOld);
}
}
}
void GetSystemSettings(bool bUpdate)
{
if((m_dwExtendedStyle & SPLIT_FIXEDBARSIZE) == 0)
{
#ifndef _WIN32_WCE
m_cxySplitBar = ::GetSystemMetrics(t_bVertical ? SM_CXSIZEFRAME : SM_CYSIZEFRAME);
#else // CE specific
m_cxySplitBar = 2 * ::GetSystemMetrics(t_bVertical ? SM_CXEDGE : SM_CYEDGE);
#endif // _WIN32_WCE
}
T* pT = static_cast<T*>(this);
if((pT->GetExStyle() & WS_EX_CLIENTEDGE))
{
m_cxyBarEdge = 2 * ::GetSystemMetrics(t_bVertical ? SM_CXEDGE : SM_CYEDGE);
m_cxyMin = 0;
}
else
{
m_cxyBarEdge = 0;
m_cxyMin = 2 * ::GetSystemMetrics(t_bVertical ? SM_CXEDGE : SM_CYEDGE);
}
#ifndef _WIN32_WCE
::SystemParametersInfo(SPI_GETDRAGFULLWINDOWS, 0, &m_bFullDrag, 0);
#endif // !_WIN32_WCE
if(bUpdate)
UpdateSplitterLayout();
}
bool IsProportional() const
{
return ((m_dwExtendedStyle & SPLIT_PROPORTIONAL) != 0);
}
void StoreProportionalPos()
{
int cxyTotal = t_bVertical ? (m_rcSplitter.right - m_rcSplitter.left - m_cxySplitBar - m_cxyBarEdge) : (m_rcSplitter.bottom - m_rcSplitter.top - m_cxySplitBar - m_cxyBarEdge);
if(cxyTotal > 0)
m_nProportionalPos = ::MulDiv(m_xySplitterPos, m_nPropMax, cxyTotal);
else
m_nProportionalPos = 0;
ATLTRACE2(atlTraceUI, 0, _T("CSplitterImpl::StoreProportionalPos - %i\n"), m_nProportionalPos);
}
void UpdateProportionalPos()
{
int cxyTotal = t_bVertical ? (m_rcSplitter.right - m_rcSplitter.left - m_cxySplitBar - m_cxyBarEdge) : (m_rcSplitter.bottom - m_rcSplitter.top - m_cxySplitBar - m_cxyBarEdge);
if(cxyTotal > 0)
{
int xyNewPos = ::MulDiv(m_nProportionalPos, cxyTotal, m_nPropMax);
m_bUpdateProportionalPos = false;
T* pT = static_cast<T*>(this);
pT->SetSplitterPos(xyNewPos, false);
}
}
bool IsRightAligned() const
{
return ((m_dwExtendedStyle & SPLIT_RIGHTALIGNED) != 0);
}
void StoreRightAlignPos()
{
int cxyTotal = t_bVertical ? (m_rcSplitter.right - m_rcSplitter.left - m_cxySplitBar - m_cxyBarEdge) : (m_rcSplitter.bottom - m_rcSplitter.top - m_cxySplitBar - m_cxyBarEdge);
if(cxyTotal > 0)
m_nProportionalPos = cxyTotal - m_xySplitterPos;
else
m_nProportionalPos = 0;
ATLTRACE2(atlTraceUI, 0, _T("CSplitterImpl::StoreRightAlignPos - %i\n"), m_nProportionalPos);
}
void UpdateRightAlignPos()
{
int cxyTotal = t_bVertical ? (m_rcSplitter.right - m_rcSplitter.left - m_cxySplitBar - m_cxyBarEdge) : (m_rcSplitter.bottom - m_rcSplitter.top - m_cxySplitBar - m_cxyBarEdge);
if(cxyTotal > 0)
{
m_bUpdateProportionalPos = false;
T* pT = static_cast<T*>(this);
pT->SetSplitterPos(cxyTotal - m_nProportionalPos, false);
}
}
bool IsInteractive() const
{
return ((m_dwExtendedStyle & SPLIT_NONINTERACTIVE) == 0);
}
};
template <class T, bool t_bVertical> HCURSOR CSplitterImpl< T, t_bVertical>::m_hCursor = NULL;
///////////////////////////////////////////////////////////////////////////////
// CSplitterWindowImpl - Implements a splitter window
template <class T, bool t_bVertical = true, class TBase = ATL::CWindow, class TWinTraits = ATL::CControlWinTraits>
class ATL_NO_VTABLE CSplitterWindowImpl : public ATL::CWindowImpl< T, TBase, TWinTraits >, public CSplitterImpl< T , t_bVertical >
{
public:
DECLARE_WND_CLASS_EX(NULL, CS_DBLCLKS, COLOR_WINDOW)
typedef CSplitterImpl< T , t_bVertical > _baseClass;
BEGIN_MSG_MAP(CSplitterWindowImpl)
MESSAGE_HANDLER(WM_ERASEBKGND, OnEraseBackground)
MESSAGE_HANDLER(WM_SIZE, OnSize)
CHAIN_MSG_MAP(_baseClass)
FORWARD_NOTIFICATIONS()
END_MSG_MAP()
LRESULT OnEraseBackground(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
// handled, no background painting needed
return 1;
}
LRESULT OnSize(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled)
{
if(wParam != SIZE_MINIMIZED)
SetSplitterRect();
bHandled = FALSE;
return 1;
}
};
///////////////////////////////////////////////////////////////////////////////
// CSplitterWindow - Implements a splitter window to be used as is
template <bool t_bVertical = true>
class CSplitterWindowT : public CSplitterWindowImpl<CSplitterWindowT<t_bVertical>, t_bVertical>
{
public:
DECLARE_WND_CLASS_EX(_T("WTL_SplitterWindow"), CS_DBLCLKS, COLOR_WINDOW)
};
typedef CSplitterWindowT<true> CSplitterWindow;
typedef CSplitterWindowT<false> CHorSplitterWindow;
}; // namespace WTL
#endif // __ATLSPLIT_H__

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,595 +0,0 @@
// Windows Template Library - WTL version 8.1
// Copyright (C) Microsoft Corporation. All rights reserved.
//
// This file is a part of the Windows Template Library.
// The use and distribution terms for this software are covered by the
// Common Public License 1.0 (http://opensource.org/licenses/cpl1.0.php)
// which can be found in the file CPL.TXT at the root of this distribution.
// By using this software in any fashion, you are agreeing to be bound by
// the terms of this license. You must not remove this notice, or
// any other, from this software.
#ifndef __ATLWINX_H__
#define __ATLWINX_H__
#pragma once
#ifndef __ATLAPP_H__
#error atlwinx.h requires atlapp.h to be included first
#endif
#if (_ATL_VER >= 0x0700)
#include <atlwin.h>
#endif // (_ATL_VER >= 0x0700)
///////////////////////////////////////////////////////////////////////////////
// Classes in this file:
//
// _U_RECT
// _U_MENUorID
// _U_STRINGorID
///////////////////////////////////////////////////////////////////////////////
// Command Chaining Macros
#define CHAIN_COMMANDS(theChainClass) \
if(uMsg == WM_COMMAND) \
CHAIN_MSG_MAP(theChainClass)
#define CHAIN_COMMANDS_ALT(theChainClass, msgMapID) \
if(uMsg == WM_COMMAND) \
CHAIN_MSG_MAP_ALT(theChainClass, msgMapID)
#define CHAIN_COMMANDS_MEMBER(theChainMember) \
if(uMsg == WM_COMMAND) \
CHAIN_MSG_MAP_MEMBER(theChainMember)
#define CHAIN_COMMANDS_ALT_MEMBER(theChainMember, msgMapID) \
if(uMsg == WM_COMMAND) \
CHAIN_MSG_MAP_ALT_MEMBER(theChainMember, msgMapID)
///////////////////////////////////////////////////////////////////////////////
// Macros for parent message map to selectively reflect control messages
// NOTE: ReflectNotifications is a member of ATL's CWindowImplRoot
// (and overridden in 2 cases - CContainedWindowT and CAxHostWindow)
// Since we can't modify ATL, we'll provide the needed additions
// in a separate function (that is not a member of CWindowImplRoot)
namespace WTL
{
inline LRESULT WtlReflectNotificationsFiltered(HWND hWndParent, UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled,
UINT uMsgFilter = WM_NULL, UINT_PTR idFromFilter = 0, HWND hWndChildFilter = NULL)
{
if((uMsgFilter != WM_NULL) && (uMsgFilter != uMsg))
{
// The notification message doesn't match the filter.
bHandled = FALSE;
return 1;
}
HWND hWndChild = NULL;
UINT_PTR idFrom = 0;
switch(uMsg)
{
case WM_COMMAND:
if(lParam != NULL) // not from a menu
{
hWndChild = (HWND)lParam;
idFrom = (UINT_PTR)LOWORD(wParam);
}
break;
case WM_NOTIFY:
hWndChild = ((LPNMHDR)lParam)->hwndFrom;
idFrom = ((LPNMHDR)lParam)->idFrom;
break;
#ifndef _WIN32_WCE
case WM_PARENTNOTIFY:
switch(LOWORD(wParam))
{
case WM_CREATE:
case WM_DESTROY:
hWndChild = (HWND)lParam;
idFrom = (UINT_PTR)HIWORD(wParam);
break;
default:
hWndChild = ::GetDlgItem(hWndParent, HIWORD(wParam));
idFrom = (UINT_PTR)::GetDlgCtrlID(hWndChild);
break;
}
break;
#endif // !_WIN32_WCE
case WM_DRAWITEM:
if(wParam) // not from a menu
{
hWndChild = ((LPDRAWITEMSTRUCT)lParam)->hwndItem;
idFrom = (UINT_PTR)wParam;
}
break;
case WM_MEASUREITEM:
if(wParam) // not from a menu
{
hWndChild = ::GetDlgItem(hWndParent, ((LPMEASUREITEMSTRUCT)lParam)->CtlID);
idFrom = (UINT_PTR)wParam;
}
break;
case WM_COMPAREITEM:
if(wParam) // not from a menu
{
hWndChild = ((LPCOMPAREITEMSTRUCT)lParam)->hwndItem;
idFrom = (UINT_PTR)wParam;
}
break;
case WM_DELETEITEM:
if(wParam) // not from a menu
{
hWndChild = ((LPDELETEITEMSTRUCT)lParam)->hwndItem;
idFrom = (UINT_PTR)wParam;
}
break;
case WM_VKEYTOITEM:
case WM_CHARTOITEM:
case WM_HSCROLL:
case WM_VSCROLL:
hWndChild = (HWND)lParam;
idFrom = (UINT_PTR)::GetDlgCtrlID(hWndChild);
break;
case WM_CTLCOLORBTN:
case WM_CTLCOLORDLG:
case WM_CTLCOLOREDIT:
case WM_CTLCOLORLISTBOX:
case WM_CTLCOLORMSGBOX:
case WM_CTLCOLORSCROLLBAR:
case WM_CTLCOLORSTATIC:
hWndChild = (HWND)lParam;
idFrom = (UINT_PTR)::GetDlgCtrlID(hWndChild);
break;
default:
break;
}
if((hWndChild == NULL) ||
((hWndChildFilter != NULL) && (hWndChildFilter != hWndChild)))
{
// Either hWndChild isn't valid, or
// hWndChild doesn't match the filter.
bHandled = FALSE;
return 1;
}
if((idFromFilter != 0) && (idFromFilter != idFrom))
{
// The dialog control id doesn't match the filter.
bHandled = FALSE;
return 1;
}
ATLASSERT(::IsWindow(hWndChild));
LRESULT lResult = ::SendMessage(hWndChild, OCM__BASE + uMsg, wParam, lParam);
if((lResult == 0) && (uMsg >= WM_CTLCOLORMSGBOX) && (uMsg <= WM_CTLCOLORSTATIC))
{
// Try to prevent problems with WM_CTLCOLOR* messages when
// the message wasn't really handled
bHandled = FALSE;
}
return lResult;
}
}; // namespace WTL
// Try to prevent problems with WM_CTLCOLOR* messages when
// the message wasn't really handled
#define REFLECT_NOTIFICATIONS_EX() \
{ \
bHandled = TRUE; \
lResult = ReflectNotifications(uMsg, wParam, lParam, bHandled); \
if((lResult == 0) && (uMsg >= WM_CTLCOLORMSGBOX) && (uMsg <= WM_CTLCOLORSTATIC)) \
bHandled = FALSE; \
if(bHandled) \
return TRUE; \
}
#define REFLECT_NOTIFICATIONS_MSG_FILTERED(uMsgFilter) \
{ \
bHandled = TRUE; \
lResult = WTL::WtlReflectNotificationsFiltered(m_hWnd, uMsg, wParam, lParam, bHandled, uMsgFilter, 0, NULL); \
if(bHandled) \
return TRUE; \
}
#define REFLECT_NOTIFICATIONS_ID_FILTERED(idFromFilter) \
{ \
bHandled = TRUE; \
lResult = WTL::WtlReflectNotificationsFiltered(m_hWnd, uMsg, wParam, lParam, bHandled, WM_NULL, idFromFilter, NULL); \
if(bHandled) \
return TRUE; \
}
#define REFLECT_NOTIFICATIONS_HWND_FILTERED(hWndChildFilter) \
{ \
bHandled = TRUE; \
lResult = WTL::WtlReflectNotificationsFiltered(m_hWnd, uMsg, wParam, lParam, bHandled, WM_NULL, 0, hWndChildFilter); \
if(bHandled) \
return TRUE; \
}
#define REFLECT_NOTIFICATIONS_MSG_ID_FILTERED(uMsgFilter, idFromFilter) \
{ \
bHandled = TRUE; \
lResult = WTL::WtlReflectNotificationsFiltered(m_hWnd, uMsg, wParam, lParam, bHandled, uMsgFilter, idFromFilter, NULL); \
if(bHandled) \
return TRUE; \
}
#define REFLECT_NOTIFICATIONS_MSG_HWND_FILTERED(uMsgFilter, hWndChildFilter) \
{ \
bHandled = TRUE; \
lResult = WTL::WtlReflectNotificationsFiltered(m_hWnd, uMsg, wParam, lParam, bHandled, uMsgFilter, 0, hWndChildFilter); \
if(bHandled) \
return TRUE; \
}
#define REFLECT_COMMAND(id, code) \
if(uMsg == WM_COMMAND && id == LOWORD(wParam) && code == HIWORD(wParam)) \
{ \
bHandled = TRUE; \
lResult = ReflectNotifications(uMsg, wParam, lParam, bHandled); \
if(bHandled) \
return TRUE; \
}
#define REFLECT_COMMAND_ID(id) \
if(uMsg == WM_COMMAND && id == LOWORD(wParam)) \
{ \
bHandled = TRUE; \
lResult = ReflectNotifications(uMsg, wParam, lParam, bHandled); \
if(bHandled) \
return TRUE; \
}
#define REFLECT_COMMAND_CODE(code) \
if(uMsg == WM_COMMAND && code == HIWORD(wParam)) \
{ \
bHandled = TRUE; \
lResult = ReflectNotifications(uMsg, wParam, lParam, bHandled); \
if(bHandled) \
return TRUE; \
}
#define REFLECT_COMMAND_RANGE(idFirst, idLast) \
if(uMsg == WM_COMMAND && LOWORD(wParam) >= idFirst && LOWORD(wParam) <= idLast) \
{ \
bHandled = TRUE; \
lResult = ReflectNotifications(uMsg, wParam, lParam, bHandled); \
if(bHandled) \
return TRUE; \
}
#define REFLECT_COMMAND_RANGE_CODE(idFirst, idLast, code) \
if(uMsg == WM_COMMAND && code == HIWORD(wParam) && LOWORD(wParam) >= idFirst && LOWORD(wParam) <= idLast) \
{ \
bHandled = TRUE; \
lResult = ReflectNotifications(uMsg, wParam, lParam, bHandled); \
if(bHandled) \
return TRUE; \
}
#define REFLECT_NOTIFY(id, cd) \
if(uMsg == WM_NOTIFY && id == ((LPNMHDR)lParam)->idFrom && cd == ((LPNMHDR)lParam)->code) \
{ \
bHandled = TRUE; \
lResult = ReflectNotifications(uMsg, wParam, lParam, bHandled); \
if(bHandled) \
return TRUE; \
}
#define REFLECT_NOTIFY_ID(id) \
if(uMsg == WM_NOTIFY && id == ((LPNMHDR)lParam)->idFrom) \
{ \
bHandled = TRUE; \
lResult = ReflectNotifications(uMsg, wParam, lParam, bHandled); \
if(bHandled) \
return TRUE; \
}
#define REFLECT_NOTIFY_CODE(cd) \
if(uMsg == WM_NOTIFY && cd == ((LPNMHDR)lParam)->code) \
{ \
bHandled = TRUE; \
lResult = ReflectNotifications(uMsg, wParam, lParam, bHandled); \
if(bHandled) \
return TRUE; \
}
#define REFLECT_NOTIFY_RANGE(idFirst, idLast) \
if(uMsg == WM_NOTIFY && ((LPNMHDR)lParam)->idFrom >= idFirst && ((LPNMHDR)lParam)->idFrom <= idLast) \
{ \
bHandled = TRUE; \
lResult = ReflectNotifications(uMsg, wParam, lParam, bHandled); \
if(bHandled) \
return TRUE; \
}
#define REFLECT_NOTIFY_RANGE_CODE(idFirst, idLast, cd) \
if(uMsg == WM_NOTIFY && cd == ((LPNMHDR)lParam)->code && ((LPNMHDR)lParam)->idFrom >= idFirst && ((LPNMHDR)lParam)->idFrom <= idLast) \
{ \
bHandled = TRUE; \
lResult = ReflectNotifications(uMsg, wParam, lParam, bHandled); \
if(bHandled) \
return TRUE; \
}
///////////////////////////////////////////////////////////////////////////////
// Reflected message handler macros for message maps (for ATL 3.0)
#if (_ATL_VER < 0x0700)
#define REFLECTED_COMMAND_HANDLER(id, code, func) \
if(uMsg == OCM_COMMAND && id == LOWORD(wParam) && code == HIWORD(wParam)) \
{ \
bHandled = TRUE; \
lResult = func(HIWORD(wParam), LOWORD(wParam), (HWND)lParam, bHandled); \
if(bHandled) \
return TRUE; \
}
#define REFLECTED_COMMAND_ID_HANDLER(id, func) \
if(uMsg == OCM_COMMAND && id == LOWORD(wParam)) \
{ \
bHandled = TRUE; \
lResult = func(HIWORD(wParam), LOWORD(wParam), (HWND)lParam, bHandled); \
if(bHandled) \
return TRUE; \
}
#define REFLECTED_COMMAND_CODE_HANDLER(code, func) \
if(uMsg == OCM_COMMAND && code == HIWORD(wParam)) \
{ \
bHandled = TRUE; \
lResult = func(HIWORD(wParam), LOWORD(wParam), (HWND)lParam, bHandled); \
if(bHandled) \
return TRUE; \
}
#define REFLECTED_COMMAND_RANGE_HANDLER(idFirst, idLast, func) \
if(uMsg == OCM_COMMAND && LOWORD(wParam) >= idFirst && LOWORD(wParam) <= idLast) \
{ \
bHandled = TRUE; \
lResult = func(HIWORD(wParam), LOWORD(wParam), (HWND)lParam, bHandled); \
if(bHandled) \
return TRUE; \
}
#define REFLECTED_COMMAND_RANGE_CODE_HANDLER(idFirst, idLast, code, func) \
if(uMsg == OCM_COMMAND && code == HIWORD(wParam) && LOWORD(wParam) >= idFirst && LOWORD(wParam) <= idLast) \
{ \
bHandled = TRUE; \
lResult = func(HIWORD(wParam), LOWORD(wParam), (HWND)lParam, bHandled); \
if(bHandled) \
return TRUE; \
}
#define REFLECTED_NOTIFY_HANDLER(id, cd, func) \
if(uMsg == OCM_NOTIFY && id == ((LPNMHDR)lParam)->idFrom && cd == ((LPNMHDR)lParam)->code) \
{ \
bHandled = TRUE; \
lResult = func((int)wParam, (LPNMHDR)lParam, bHandled); \
if(bHandled) \
return TRUE; \
}
#define REFLECTED_NOTIFY_ID_HANDLER(id, func) \
if(uMsg == OCM_NOTIFY && id == ((LPNMHDR)lParam)->idFrom) \
{ \
bHandled = TRUE; \
lResult = func((int)wParam, (LPNMHDR)lParam, bHandled); \
if(bHandled) \
return TRUE; \
}
#define REFLECTED_NOTIFY_CODE_HANDLER(cd, func) \
if(uMsg == OCM_NOTIFY && cd == ((LPNMHDR)lParam)->code) \
{ \
bHandled = TRUE; \
lResult = func((int)wParam, (LPNMHDR)lParam, bHandled); \
if(bHandled) \
return TRUE; \
}
#define REFLECTED_NOTIFY_RANGE_HANDLER(idFirst, idLast, func) \
if(uMsg == OCM_NOTIFY && ((LPNMHDR)lParam)->idFrom >= idFirst && ((LPNMHDR)lParam)->idFrom <= idLast) \
{ \
bHandled = TRUE; \
lResult = func((int)wParam, (LPNMHDR)lParam, bHandled); \
if(bHandled) \
return TRUE; \
}
#define REFLECTED_NOTIFY_RANGE_CODE_HANDLER(idFirst, idLast, cd, func) \
if(uMsg == OCM_NOTIFY && cd == ((LPNMHDR)lParam)->code && ((LPNMHDR)lParam)->idFrom >= idFirst && ((LPNMHDR)lParam)->idFrom <= idLast) \
{ \
bHandled = TRUE; \
lResult = func((int)wParam, (LPNMHDR)lParam, bHandled); \
if(bHandled) \
return TRUE; \
}
#endif // (_ATL_VER < 0x0700)
///////////////////////////////////////////////////////////////////////////////
// Dual argument helper classes (for ATL 3.0)
#if (_ATL_VER < 0x0700)
namespace ATL
{
class _U_RECT
{
public:
_U_RECT(LPRECT lpRect) : m_lpRect(lpRect)
{ }
_U_RECT(RECT& rc) : m_lpRect(&rc)
{ }
LPRECT m_lpRect;
};
class _U_MENUorID
{
public:
_U_MENUorID(HMENU hMenu) : m_hMenu(hMenu)
{ }
_U_MENUorID(UINT nID) : m_hMenu((HMENU)LongToHandle(nID))
{ }
HMENU m_hMenu;
};
class _U_STRINGorID
{
public:
_U_STRINGorID(LPCTSTR lpString) : m_lpstr(lpString)
{ }
_U_STRINGorID(UINT nID) : m_lpstr(MAKEINTRESOURCE(nID))
{ }
LPCTSTR m_lpstr;
};
}; // namespace ATL
#endif // (_ATL_VER < 0x0700)
namespace WTL
{
///////////////////////////////////////////////////////////////////////////////
// Forward notifications support for message maps (for ATL 3.0)
#if (_ATL_VER < 0x0700)
// forward notifications support
#define FORWARD_NOTIFICATIONS() \
{ \
bHandled = TRUE; \
lResult = WTL::Atl3ForwardNotifications(m_hWnd, uMsg, wParam, lParam, bHandled); \
if(bHandled) \
return TRUE; \
}
static LRESULT Atl3ForwardNotifications(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
LRESULT lResult = 0;
switch(uMsg)
{
case WM_COMMAND:
case WM_NOTIFY:
#ifndef _WIN32_WCE
case WM_PARENTNOTIFY:
#endif // !_WIN32_WCE
case WM_DRAWITEM:
case WM_MEASUREITEM:
case WM_COMPAREITEM:
case WM_DELETEITEM:
case WM_VKEYTOITEM:
case WM_CHARTOITEM:
case WM_HSCROLL:
case WM_VSCROLL:
case WM_CTLCOLORBTN:
case WM_CTLCOLORDLG:
case WM_CTLCOLOREDIT:
case WM_CTLCOLORLISTBOX:
case WM_CTLCOLORMSGBOX:
case WM_CTLCOLORSCROLLBAR:
case WM_CTLCOLORSTATIC:
lResult = ::SendMessage(::GetParent(hWnd), uMsg, wParam, lParam);
break;
default:
bHandled = FALSE;
break;
}
return lResult;
}
#endif // (_ATL_VER < 0x0700)
#define DEFAULT_DPI 96.0
typedef struct tagSIZEF
{
FLOAT cx;
FLOAT cy;
} SIZEF, *PSIZEF, *LPSIZEF;
inline ATLAPI_(SIZE) Dpi()
{
SIZE dpi;
int nPixelsPerInchX; // Pixels per logical inch along width
int nPixelsPerInchY; // Pixels per logical inch along height
HDC hDCScreen = GetDC(NULL); // Gets DC of virtual display
ATLASSUME(hDCScreen != NULL);
nPixelsPerInchX = GetDeviceCaps(hDCScreen, LOGPIXELSX);
nPixelsPerInchY = GetDeviceCaps(hDCScreen, LOGPIXELSY);
ReleaseDC(NULL, hDCScreen);
dpi.cx = nPixelsPerInchX;
dpi.cy = nPixelsPerInchY;
return dpi;
}
inline ATLAPI_(SIZEF) DpiScale()
{
SIZE dpi = Dpi();
SIZEF dpiScale = { (FLOAT)dpi.cx, (FLOAT)dpi.cy };
dpiScale.cx /= DEFAULT_DPI;
dpiScale.cy /= DEFAULT_DPI;
return dpiScale;
}
inline ATLAPI_(SIZE) Dpi(
_In_ const HWND &hWnd)
{
ATLENSURE_THROW(hWnd != NULL, E_POINTER);
SIZE dpi;
int nPixelsPerInchX; // Pixels per logical inch along width
int nPixelsPerInchY; // Pixels per logical inch along height
HDC hDCWindow = GetDC(hWnd);
ATLASSUME(hDCWindow != NULL);
nPixelsPerInchX = GetDeviceCaps(hDCWindow, LOGPIXELSX);
nPixelsPerInchY = GetDeviceCaps(hDCWindow, LOGPIXELSY);
ReleaseDC(hWnd, hDCWindow);
dpi.cx = nPixelsPerInchX;
dpi.cy = nPixelsPerInchY;
return dpi;
}
inline ATLAPI_(SIZEF) DpiScale(
_In_ const HWND &hWnd)
{
ATLENSURE_THROW(hWnd != NULL, E_POINTER);
SIZE dpi = Dpi(hWnd);
SIZEF dpiScale = { (FLOAT)dpi.cx, (FLOAT)dpi.cy };
dpiScale.cx /= DEFAULT_DPI;
dpiScale.cy /= DEFAULT_DPI;
return dpiScale;
}
}; // namespace WTL
#endif // __ATLWINX_H__

View File

@ -1,40 +0,0 @@
#include "config-debug.h"
#include "../Config.h"
#include "../DebugDump.h"
#include "Language.h"
#include "resource.h"
CDebugTab::CDebugTab() :
CConfigTab(IDD_TAB_DEBUG)
{
}
BOOL CDebugTab::OnInitDialog(CWindow /*wndFocus*/, LPARAM /*lInitParam*/) {
return true;
}
void CDebugTab::ApplyLanguage(void) {
SetDlgItemTextW(IDC_CHK_DUMP_LOW, wGS(DEBUG_DUMP_LOWLEVEL_INFO).c_str());
SetDlgItemTextW(IDC_CHK_DUMP_NORMAL, wGS(DEBUG_DUMP_DISPLAY_LIST).c_str());
SetDlgItemTextW(IDC_CHK_DUMP_DETAIL, wGS(DEBUG_DUMP_DETAILED_INFO).c_str());
}
LRESULT CDebugTab::OnColorStatic(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) {
return (LRESULT)GetStockObject(WHITE_BRUSH);
}
void CDebugTab::LoadSettings(bool /*blockCustomSettings*/) {
CButton(GetDlgItem(IDC_CHK_DUMP_LOW)).SetCheck((config.debug.dumpMode & DEBUG_LOW) != 0 ? BST_CHECKED : BST_UNCHECKED);
CButton(GetDlgItem(IDC_CHK_DUMP_NORMAL)).SetCheck((config.debug.dumpMode & DEBUG_NORMAL) != 0 ? BST_CHECKED : BST_UNCHECKED);
CButton(GetDlgItem(IDC_CHK_DUMP_DETAIL)).SetCheck((config.debug.dumpMode & DEBUG_DETAIL) != 0 ? BST_CHECKED : BST_UNCHECKED);
}
void CDebugTab::SaveSettings() {
config.debug.dumpMode = 0;
if (CButton(GetDlgItem(IDC_CHK_DUMP_LOW)).GetCheck() == BST_CHECKED)
config.debug.dumpMode |= DEBUG_LOW;
if (CButton(GetDlgItem(IDC_CHK_DUMP_NORMAL)).GetCheck() == BST_CHECKED)
config.debug.dumpMode |= DEBUG_NORMAL;
if (CButton(GetDlgItem(IDC_CHK_DUMP_DETAIL)).GetCheck() == BST_CHECKED)
config.debug.dumpMode |= DEBUG_DETAIL;
}

View File

@ -1,21 +0,0 @@
#pragma once
#include "config-tab.h"
class CDebugTab :
public CConfigTab
{
public:
BEGIN_MSG_MAP(CEmulationTab)
MSG_WM_INITDIALOG(OnInitDialog)
MESSAGE_HANDLER(WM_CTLCOLORDLG, OnColorStatic)
MESSAGE_HANDLER(WM_CTLCOLORSTATIC, OnColorStatic)
END_MSG_MAP()
CDebugTab();
BOOL OnInitDialog(CWindow /*wndFocus*/, LPARAM /*lInitParam*/);
LRESULT OnColorStatic(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
void ApplyLanguage(void);
void LoadSettings(bool /*blockCustomSettings*/);
void SaveSettings();
};

View File

@ -1,216 +0,0 @@
#include "config-emulation.h"
#include "util/util.h"
#include "../Config.h"
#include "resource.h"
#include "ConfigDlg.h"
CEmulationTab::CEmulationTab(CConfigDlg & Dlg) :
CConfigTab(IDD_TAB_EMULATION),
m_Dlg(Dlg)
{
}
BOOL CEmulationTab::OnInitDialog(CWindow /*wndFocus*/, LPARAM /*lInitParam*/)
{
TTInit();
TTSize(400);
CComboBox nativeRes2DComboBox(GetDlgItem(IDC_CMB_NATIVE_RES_2D));
nativeRes2DComboBox.ResetContent();
nativeRes2DComboBox.AddString(wGS(EMULATION_RENDER_DISABLE).c_str());
nativeRes2DComboBox.AddString(wGS(EMULATION_RENDER_ENABLE_OPTIMIZED).c_str());
nativeRes2DComboBox.AddString(wGS(EMULATION_RENDER_ENABLE_UNOPTIMIZED).c_str());
m_GammaTxt.Attach(GetDlgItem(IDC_GAMMA_VALUE));
m_GammaSpin.Attach(GetDlgItem(IDC_GAMMA_SPIN));
m_GammaSpin.SetBase(10);
m_GammaSpin.SetRange(10, 40);
m_GammaSpin.SetPos(20);
m_GammaSpin.SetBuddy(m_GammaTxt);
m_N64ResMultiplerTxt.Attach(GetDlgItem(IDC_N64_RES_MULTIPLER_TXT));
m_N64ResMultiplerSpin.Attach(GetDlgItem(IDC_N64_RES_MULTIPLER_SPIN));
m_N64ResMultiplerSpin.SetBase(10);
m_N64ResMultiplerSpin.SetRange(2, 16);
m_N64ResMultiplerSpin.SetPos(2);
m_N64ResMultiplerSpin.SetBuddy(m_N64ResMultiplerTxt);
SIZE iconSz = { ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON) };
m_GammaIcon.SubclassWindow(GetDlgItem(IDC_GAMMA_ICON));
m_GammaIcon.SetIcon(MAKEINTRESOURCE(IDI_ICON_INFO), iconSz.cx, iconSz.cy);
m_GammaIcon.SetWindowPos(HWND_TOP, 0, 0, iconSz.cx, iconSz.cy, SWP_NOMOVE | SWP_NOZORDER);
m_GammaIcon.SetBackroundBrush((HBRUSH)GetStockObject(WHITE_BRUSH));
return true;
}
LRESULT CEmulationTab::OnColorStatic(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
return (LRESULT)GetStockObject(WHITE_BRUSH);
}
void CEmulationTab::OnGammaCorrection(UINT /*Code*/, int /*id*/, HWND /*ctl*/)
{
CButton OverScan(GetDlgItem(IDC_CHK_GAMMA_CORRECTION));
if (OverScan.GetCheck() == BST_CHECKED) {
GetDlgItem(IDC_GAMMA_ICON).ShowWindow(SW_SHOW);
GetDlgItem(IDC_GAMMA_INFO).ShowWindow(SW_SHOW);
} else {
GetDlgItem(IDC_GAMMA_ICON).ShowWindow(SW_HIDE);
GetDlgItem(IDC_GAMMA_INFO).ShowWindow(SW_HIDE);
}
}
void CEmulationTab::OnPerGameSettings(UINT /*Code*/, int /*id*/, HWND /*ctl*/)
{
m_Dlg.OnCustomSettingsToggled(CButton(GetDlgItem(IDC_CHK_USE_PER_GAME)).GetCheck() == BST_CHECKED);
}
void CEmulationTab::ApplyLanguage(void)
{
SetDlgItemTextW(IDC_CHK_USE_PER_GAME, wGS(EMULATION_USE_PER_GAME).c_str());
SetDlgItemTextW(IDC_CHK_N64_STYLE_MIP_MAPPING, wGS(EMULATION_N64_STYLE_MIP_MAPPING).c_str());
SetDlgItemTextW(IDC_CHK_HWLIGHTING, wGS(EMULATION_HWLIGHTING).c_str());
SetDlgItemTextW(IDC_CHK_PIXEL_COVERAGE, wGS(EMULATION_PIXEL_COVERAGE).c_str());
SetDlgItemTextW(IDC_CHK_SHADERS_STORAGE, wGS(EMULATION_SHADERS_STORAGE).c_str());
SetDlgItemTextW(IDC_INTERNAL_RES_GROUP, wGS(EMULATION_INTERNAL_RES).c_str());
SetDlgItemTextW(IDC_FACTOR0X_RADIO, wGS(EMULATION_FACTOR0X).c_str());
SetDlgItemTextW(IDC_FACTOR1X_RADIO, wGS(EMULATION_FACTOR1X).c_str());
SetDlgItemTextW(IDC_FACTORXX_RADIO, wGS(EMULATION_FACTORXX).c_str());
SetDlgItemTextW(IDC_GAMMA_GROUP, wGS(EMULATION_GAMMA).c_str());
SetDlgItemTextW(IDC_CHK_GAMMA_CORRECTION, wGS(EMULATION_GAMMA_CORRECTION).c_str());
SetDlgItemTextW(IDC_GAMMA_INFO, wGS(EMULATION_GAMMA_INFO).c_str());
SetDlgItemTextW(IDC_2D_ELEMENTS_GROUP, wGS(EMULATION_2D_ELEMENTS).c_str());
SetDlgItemTextW(IDC_RENDER_2D_ELEMENTS, wGS(EMULATION_RENDER_2D_ELEMENTS).c_str());
SetDlgItemTextW(IDC_CHK_HALOS_REMOVAL, wGS(EMULATION_HALOS_REMOVAL).c_str());
SetDlgItemTextW(IDC_TXT_FIXBLACK_LINES, wGS(EMULATION_FIX_BLACK_LINES).c_str());
SetDlgItemTextW(IDC_FIXTEXRECT_SMART, wGS(EMULATION_ADJACENT_2D_ELEMENTS).c_str());
SetDlgItemTextW(IDC_FIXTEXRECT_FORCE, wGS(EMULATION_ALWAYS).c_str());
SetDlgItemTextW(IDC_FIXTEXRECT_NEVER, wGS(EMULATION_NEVER).c_str());
SetDlgItemTextW(IDC_TXT_BACKGROUND_RENDERING, wGS(EMULATION_BACKGROUND).c_str());
SetDlgItemTextW(IDC_BGMODE_ONEPIECE, wGS(EMULATION_ONE_PIECE).c_str());
SetDlgItemTextW(IDC_BGMODE_STRIPPED, wGS(EMULATION_STRIPPED).c_str());
std::wstring tooltip = wGS(EMULATION_USE_PER_GAME_TOOLTIP);
TTSetTxt(GetDlgItem(IDC_CHK_USE_PER_GAME), tooltip.c_str());
tooltip = wGS(EMULATION_N64_STYLE_MIP_MAPPING_TOOLTIP);
TTSetTxt(GetDlgItem(IDC_CHK_N64_STYLE_MIP_MAPPING), tooltip.c_str());
tooltip = wGS(EMULATION_HWLIGHTING_TOOLTIP);
TTSetTxt(GetDlgItem(IDC_CHK_HWLIGHTING), tooltip.c_str());
tooltip = wGS(EMULATION_PIXEL_COVERAGE_TOOLTIP);
TTSetTxt(GetDlgItem(IDC_CHK_PIXEL_COVERAGE), tooltip.c_str());
tooltip = wGS(EMULATION_SHADERS_STORAGE_TOOLTIP);
TTSetTxt(GetDlgItem(IDC_CHK_SHADERS_STORAGE), tooltip.c_str());
tooltip = wGS(EMULATION_INTERNAL_RES_TOOLTIP);
TTSetTxt(GetDlgItem(IDC_INTERNAL_RES_GROUP), tooltip.c_str());
TTSetTxt(GetDlgItem(IDC_FACTOR0X_RADIO), tooltip.c_str());
TTSetTxt(GetDlgItem(IDC_FACTOR1X_RADIO), tooltip.c_str());
TTSetTxt(GetDlgItem(IDC_FACTORXX_RADIO), tooltip.c_str());
tooltip = wGS(EMULATION_GAMMA_TOOLTIP);
TTSetTxt(GetDlgItem(IDC_GAMMA_GROUP), tooltip.c_str());
TTSetTxt(GetDlgItem(IDC_CHK_GAMMA_CORRECTION), tooltip.c_str());
tooltip = wGS(EMULATION_RENDER_2D_TOOLTIP);
TTSetTxt(GetDlgItem(IDC_RENDER_2D_ELEMENTS), tooltip.c_str());
TTSetTxt(GetDlgItem(IDC_CMB_NATIVE_RES_2D), tooltip.c_str());
tooltip = wGS(EMULATION_FIX_BLACK_LINES_TOOLTIP);
TTSetTxt(GetDlgItem(IDC_TXT_FIXBLACK_LINES), tooltip.c_str());
TTSetTxt(GetDlgItem(IDC_FIXTEXRECT_SMART), tooltip.c_str());
TTSetTxt(GetDlgItem(IDC_FIXTEXRECT_FORCE), tooltip.c_str());
TTSetTxt(GetDlgItem(IDC_FIXTEXRECT_NEVER), tooltip.c_str());
tooltip = wGS(EMULATION_BACKGROUND_TOOLTIP);
TTSetTxt(GetDlgItem(IDC_TXT_BACKGROUND_RENDERING), tooltip.c_str());
TTSetTxt(GetDlgItem(IDC_BGMODE_ONEPIECE), tooltip.c_str());
TTSetTxt(GetDlgItem(IDC_BGMODE_STRIPPED), tooltip.c_str());
CComboBox nativeRes2DComboBox(GetDlgItem(IDC_CMB_NATIVE_RES_2D));
int selectedIndx = nativeRes2DComboBox.GetCurSel();
nativeRes2DComboBox.ResetContent();
nativeRes2DComboBox.AddString(wGS(EMULATION_RENDER_DISABLE).c_str());
nativeRes2DComboBox.AddString(wGS(EMULATION_RENDER_ENABLE_OPTIMIZED).c_str());
nativeRes2DComboBox.AddString(wGS(EMULATION_RENDER_ENABLE_UNOPTIMIZED).c_str());
if (selectedIndx >= 0)
nativeRes2DComboBox.SetCurSel(selectedIndx);
}
void CEmulationTab::LoadSettings(bool blockCustomSettings)
{
if (!blockCustomSettings) {
CButton(GetDlgItem(IDC_CHK_USE_PER_GAME)).SetCheck(config.generalEmulation.enableCustomSettings != 0 ? BST_CHECKED : BST_UNCHECKED);
m_Dlg.OnCustomSettingsToggled(config.generalEmulation.enableCustomSettings != 0);
}
CButton(GetDlgItem(IDC_CHK_N64_STYLE_MIP_MAPPING)).SetCheck(config.generalEmulation.enableLOD != 0 ? BST_CHECKED : BST_UNCHECKED);
CButton(GetDlgItem(IDC_CHK_HWLIGHTING)).SetCheck(config.generalEmulation.enableHWLighting != 0 ? BST_CHECKED : BST_UNCHECKED);
CButton(GetDlgItem(IDC_CHK_PIXEL_COVERAGE)).SetCheck(config.generalEmulation.enableCoverage != 0 ? BST_CHECKED : BST_UNCHECKED);
CButton(GetDlgItem(IDC_CHK_SHADERS_STORAGE)).SetCheck(config.generalEmulation.enableShadersStorage != 0 ? BST_CHECKED : BST_UNCHECKED);
CButton(GetDlgItem(IDC_CHK_HALOS_REMOVAL)).SetCheck(config.texture.enableHalosRemoval != 0 ? BST_CHECKED : BST_UNCHECKED);
CButton(GetDlgItem(IDC_FIXTEXRECT_NEVER)).SetCheck(config.graphics2D.correctTexrectCoords == Config::tcDisable ? BST_CHECKED : BST_UNCHECKED);
CButton(GetDlgItem(IDC_FIXTEXRECT_SMART)).SetCheck(config.graphics2D.correctTexrectCoords == Config::tcSmart ? BST_CHECKED : BST_UNCHECKED);
CButton(GetDlgItem(IDC_FIXTEXRECT_FORCE)).SetCheck(config.graphics2D.correctTexrectCoords == Config::tcForce ? BST_CHECKED : BST_UNCHECKED);
CButton(GetDlgItem(IDC_BGMODE_ONEPIECE)).SetCheck(config.graphics2D.bgMode == Config::BGMode::bgOnePiece ? BST_CHECKED : BST_UNCHECKED);
CButton(GetDlgItem(IDC_BGMODE_STRIPPED)).SetCheck(config.graphics2D.bgMode == Config::BGMode::bgStripped ? BST_CHECKED : BST_UNCHECKED);
CComboBox nativeRes2DComboBox(GetDlgItem(IDC_CMB_NATIVE_RES_2D));
nativeRes2DComboBox.SetCurSel(config.graphics2D.enableNativeResTexrects);
CButton(GetDlgItem(IDC_CHK_GAMMA_CORRECTION)).SetCheck(config.gammaCorrection.force != 0 ? BST_CHECKED : BST_UNCHECKED);
int GammaPos = (int)(config.gammaCorrection.force != 0 ? config.gammaCorrection.level : 2.0) * 10;
m_GammaSpin.SetPos(GammaPos);
m_GammaTxt.SetWindowText(FormatStrW(L"%0.1f", (float)GammaPos / 10.0f).c_str());
GetDlgItem(IDC_GAMMA_ICON).ShowWindow(config.gammaCorrection.force != 0 ? SW_SHOW : SW_HIDE);
GetDlgItem(IDC_GAMMA_INFO).ShowWindow(config.gammaCorrection.force != 0 ? SW_SHOW : SW_HIDE);
CButton(GetDlgItem(IDC_FACTOR0X_RADIO)).SetCheck(config.frameBufferEmulation.nativeResFactor == 0 ? BST_CHECKED : BST_UNCHECKED);
CButton(GetDlgItem(IDC_FACTOR1X_RADIO)).SetCheck(config.frameBufferEmulation.nativeResFactor == 1 ? BST_CHECKED : BST_UNCHECKED);
CButton(GetDlgItem(IDC_FACTORXX_RADIO)).SetCheck(config.frameBufferEmulation.nativeResFactor > 1 ? BST_CHECKED : BST_UNCHECKED);
m_N64ResMultiplerSpin.SetPos(config.frameBufferEmulation.nativeResFactor > 1 ? config.frameBufferEmulation.nativeResFactor : 2);
m_N64ResMultiplerTxt.SetWindowText(FormatStrW(L"%dx", m_N64ResMultiplerSpin.GetPos()).c_str());
}
void CEmulationTab::SaveSettings()
{
config.generalEmulation.enableCustomSettings = CButton(GetDlgItem(IDC_CHK_USE_PER_GAME)).GetCheck() == BST_CHECKED ? 1 : 0;
config.generalEmulation.enableLOD = CButton(GetDlgItem(IDC_CHK_N64_STYLE_MIP_MAPPING)).GetCheck() == BST_CHECKED ? 1 : 0;
config.generalEmulation.enableHWLighting = CButton(GetDlgItem(IDC_CHK_HWLIGHTING)).GetCheck() == BST_CHECKED ? 1 : 0;
config.generalEmulation.enableCoverage = CButton(GetDlgItem(IDC_CHK_PIXEL_COVERAGE)).GetCheck() == BST_CHECKED ? 1 : 0;
config.generalEmulation.enableShadersStorage = CButton(GetDlgItem(IDC_CHK_SHADERS_STORAGE)).GetCheck() == BST_CHECKED ? 1 : 0;
if (CButton(GetDlgItem(IDC_FACTOR0X_RADIO)).GetCheck() == BST_CHECKED) {
config.frameBufferEmulation.nativeResFactor = 0;
} else if (CButton(GetDlgItem(IDC_FACTOR1X_RADIO)).GetCheck() == BST_CHECKED) {
config.frameBufferEmulation.nativeResFactor = 1;
} else if (CButton(GetDlgItem(IDC_FACTORXX_RADIO)).GetCheck() == BST_CHECKED) {
config.frameBufferEmulation.nativeResFactor = m_N64ResMultiplerSpin.GetPos();
}
config.gammaCorrection.force = CButton(GetDlgItem(IDC_CHK_GAMMA_CORRECTION)).GetCheck() == BST_CHECKED ? 1 : 0;
config.gammaCorrection.level = ((float)m_GammaSpin.GetPos()) / 10;
config.graphics2D.enableNativeResTexrects = CComboBox(GetDlgItem(IDC_CMB_NATIVE_RES_2D)).GetCurSel();
config.texture.enableHalosRemoval = CButton(GetDlgItem(IDC_CHK_HALOS_REMOVAL)).GetCheck() == BST_CHECKED ? 1 : 0;
if (CButton(GetDlgItem(IDC_FIXTEXRECT_NEVER)).GetCheck() == BST_CHECKED) {
config.graphics2D.correctTexrectCoords = Config::tcDisable;
} else if (CButton(GetDlgItem(IDC_FIXTEXRECT_SMART)).GetCheck() == BST_CHECKED) {
config.graphics2D.correctTexrectCoords = Config::tcSmart;
} else if (CButton(GetDlgItem(IDC_FIXTEXRECT_FORCE)).GetCheck() == BST_CHECKED) {
config.graphics2D.correctTexrectCoords = Config::tcForce;
}
if (CButton(GetDlgItem(IDC_BGMODE_ONEPIECE)).GetCheck() == BST_CHECKED) {
config.graphics2D.bgMode = Config::BGMode::bgOnePiece;
} else if (CButton(GetDlgItem(IDC_BGMODE_STRIPPED)).GetCheck() == BST_CHECKED) {
config.graphics2D.bgMode = Config::BGMode::bgStripped;
}
}
LRESULT CEmulationTab::OnScroll(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/)
{
LONG CtrlId = CWindow((HWND)lParam).GetWindowLong(GWL_ID);
if (CtrlId == IDC_GAMMA_SPIN) {
int Pos = m_GammaSpin.GetPos();
m_GammaTxt.SetWindowText(FormatStrW(L"%0.1f", (float)Pos / 10.0f).c_str());
} else if (CtrlId == IDC_N64_RES_MULTIPLER_SPIN) {
int Pos = m_N64ResMultiplerSpin.GetPos();
m_N64ResMultiplerTxt.SetWindowText(FormatStrW(L"%dx", Pos).c_str());
}
return 0;
}

View File

@ -1,41 +0,0 @@
#pragma once
#include "config-tab.h"
#include "wtl-BitmapPicture.h"
#include "wtl-tooltip.h"
#include "resource.h"
class CConfigDlg;
class CEmulationTab :
public CConfigTab,
public CToolTipDialog<CEmulationTab>
{
public:
BEGIN_MSG_MAP(CEmulationTab)
MSG_WM_INITDIALOG(OnInitDialog)
MESSAGE_HANDLER(WM_CTLCOLORDLG, OnColorStatic)
MESSAGE_HANDLER(WM_CTLCOLORSTATIC, OnColorStatic)
MESSAGE_HANDLER(WM_VSCROLL, OnScroll)
COMMAND_HANDLER_EX(IDC_CHK_GAMMA_CORRECTION, BN_CLICKED, OnGammaCorrection)
COMMAND_HANDLER_EX(IDC_CHK_USE_PER_GAME, BN_CLICKED, OnPerGameSettings)
CHAIN_MSG_MAP(CToolTipDialog<CEmulationTab>)
REFLECT_NOTIFICATIONS()
END_MSG_MAP()
CEmulationTab(CConfigDlg & Dlg);
BOOL OnInitDialog(CWindow /*wndFocus*/, LPARAM /*lInitParam*/);
LRESULT OnColorStatic(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
void OnGammaCorrection(UINT /*Code*/, int id, HWND /*ctl*/);
void OnPerGameSettings(UINT /*Code*/, int id, HWND /*ctl*/);
void ApplyLanguage(void);
void LoadSettings(bool /*blockCustomSettings*/);
void SaveSettings();
private:
LRESULT OnScroll(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/);
CEdit m_GammaTxt, m_N64ResMultiplerTxt;
CUpDownCtrl m_GammaSpin, m_N64ResMultiplerSpin;
CBitmapPicture m_GammaIcon;
CConfigDlg & m_Dlg;
};

View File

@ -1,190 +0,0 @@
#include "config-framebuffer.h"
#include "resource.h"
#include "../Config.h"
#include "Language.h"
CFrameBufferTab::CFrameBufferTab() :
CConfigTab(IDD_TAB_FRAME_BUFFER)
{
}
BOOL CFrameBufferTab::OnInitDialog(CWindow /*wndFocus*/, LPARAM /*lInitParam*/)
{
TTInit();
TTSize(400);
SIZE iconSz = { ::GetSystemMetrics(SM_CXICON), ::GetSystemMetrics(SM_CYICON) };
m_EmulateFBIcon.SubclassWindow(GetDlgItem(IDC_EMULATE_FB_ICON));
m_EmulateFBIcon.SetIcon(MAKEINTRESOURCE(IDI_ICON_WARNING), iconSz.cx, iconSz.cy);
m_EmulateFBIcon.SetWindowPos(HWND_TOP, 0, 0, iconSz.cx, iconSz.cy, SWP_NOMOVE | SWP_NOZORDER);
m_EmulateFBIcon.SetBackroundBrush((HBRUSH)GetStockObject(WHITE_BRUSH));
CComboBox frameBufferSwapComboBox(GetDlgItem(IDC_CMB_FRAMEBUFFER_SWAP));
frameBufferSwapComboBox.AddString(wGS(FRAMEBUFFER_VERTICAL_INTERRUPT).c_str());
frameBufferSwapComboBox.AddString(wGS(FRAMEBUFFER_VI_ORIGIN_CHANGE).c_str());
frameBufferSwapComboBox.AddString(wGS(FRAMEBUFFER_COLOR_BUFFER_CHANGE).c_str());
CComboBox copyColorBufferComboBox(GetDlgItem(IDC_CMB_COPY_COLOR_BUFFER));
copyColorBufferComboBox.AddString(wGS(FRAMEBUFFER_COPY_NEVER).c_str());
copyColorBufferComboBox.AddString(wGS(FRAMEBUFFER_COPY_SYNCHRONOUS).c_str());
copyColorBufferComboBox.AddString(wGS(FRAMEBUFFER_COPY_ASYNCHRONOUS).c_str());
CComboBox copyDepthBufferComboBox(GetDlgItem(IDC_CMB_COPY_DEPTH_BUFFER));
copyDepthBufferComboBox.AddString(wGS(FRAMEBUFFER_COPY_DEPTH_NEVER).c_str());
copyDepthBufferComboBox.AddString(wGS(FRAMEBUFFER_COPY_DEPTH_VRAM).c_str());
copyDepthBufferComboBox.AddString(wGS(FRAMEBUFFER_COPY_DEPTH_SOFTWARE).c_str());
CComboBox n64DepthCompareComboBox(GetDlgItem(IDC_CMB_N64_DEPTH_COMPARE));
n64DepthCompareComboBox.AddString(wGS(FRAMEBUFFER_N64_DEPTH_DISABLE).c_str());
n64DepthCompareComboBox.AddString(wGS(FRAMEBUFFER_N64_DEPTH_FAST).c_str());
n64DepthCompareComboBox.AddString(wGS(FRAMEBUFFER_N64_DEPTH_COMPATIBLE).c_str());
return true;
}
void CFrameBufferTab::ApplyLanguage(void)
{
SetDlgItemTextW(IDC_CHK_ENABLE_FRAMEBUFFER, wGS(FRAMEBUFFER_ENABLE).c_str());
SetDlgItemTextW(IDC_FRAME_BUFFER_INFO, wGS(FRAMEBUFFER_ENABLE_INFO).c_str());
SetDlgItemTextW(IDC_CHK_COPY_AUX_BUFFERS, wGS(FRAMEBUFFER_COPY_AUX_BUFFERS).c_str());
SetDlgItemTextW(IDC_TXT_FRAMEBUFFER_SWAP, wGS(FRAMEBUFFER_SWAP).c_str());
SetDlgItemTextW(IDC_CHK_FB_INFO_ENABLE, wGS(FRAMEBUFFER_INFO_ENABLE).c_str());
SetDlgItemTextW(IDC_CHK_READ_COLOR_CHUNK, wGS(FRAMEBUFFER_READ_COLOR_CHUNK).c_str());
SetDlgItemTextW(IDC_CHK_READ_DEPTH_CHUNK, wGS(FRAMEBUFFER_READ_DEPTH_CHUNK).c_str());
SetDlgItemTextW(IDC_TXT_COPY_COLOR_BUFFER, wGS(FRAMEBUFFER_COPY_COLOR_BUFFER).c_str());
SetDlgItemTextW(IDC_TXT_COPY_DEPTH_BUFFER, wGS(FRAMEBUFFER_COPY_DEPTH_BUFFER).c_str());
SetDlgItemTextW(IDC_TXT_N64_DEPTH_COMPARE, wGS(FRAMEBUFFER_N64_DEPTH_COMPARE).c_str());
SetDlgItemTextW(IDC_CHK_FORCE_DEPTH_BUFFER_CLEAR, wGS(FRAMEBUFFER_FORCE_DEPTH_BUFFER_CLEAR).c_str());
SetDlgItemTextW(IDC_CHK_RENDER_FRAMEBUFFER, wGS(FRAMEBUFFER_RENDER_FRAMEBUFFER).c_str());
SetDlgItemTextW(IDC_CHK_COPY_DEPTH_TO_MAIN_DEPTH_BUFFER, wGS(FRAMEBUFFER_COPY_DEPTH_TO_MAIN).c_str());
std::wstring tooltip = wGS(FRAMEBUFFER_COPY_AUX_BUFFERS_TOOLTIP);
TTSetTxt(GetDlgItem(IDC_CHK_COPY_AUX_BUFFERS), tooltip.c_str());
tooltip = wGS(FRAMEBUFFER_SWAP_TOOLTIP);
TTSetTxt(GetDlgItem(IDC_TXT_FRAMEBUFFER_SWAP), tooltip.c_str());
TTSetTxt(GetDlgItem(IDC_CMB_FRAMEBUFFER_SWAP), tooltip.c_str());
tooltip = wGS(FRAMEBUFFER_INFO_ENABLE_TOOLTIP);
TTSetTxt(GetDlgItem(IDC_CHK_FB_INFO_ENABLE), tooltip.c_str());
tooltip = wGS(FRAMEBUFFER_READ_COLOR_CHUNK_TOOLTIP);
TTSetTxt(GetDlgItem(IDC_CHK_READ_COLOR_CHUNK), tooltip.c_str());
tooltip = wGS(FRAMEBUFFER_READ_DEPTH_CHUNK_TOOLTIP);
TTSetTxt(GetDlgItem(IDC_CHK_READ_DEPTH_CHUNK), tooltip.c_str());
tooltip = wGS(FRAMEBUFFER_COPY_COLOR_BUFFER_TOOLTIP);
TTSetTxt(GetDlgItem(IDC_TXT_COPY_COLOR_BUFFER), tooltip.c_str());
TTSetTxt(GetDlgItem(IDC_CMB_COPY_COLOR_BUFFER), tooltip.c_str());
tooltip = wGS(FRAMEBUFFER_COPY_DEPTH_BUFFER_TOOLTIP);
TTSetTxt(GetDlgItem(IDC_TXT_COPY_COLOR_BUFFER), tooltip.c_str());
TTSetTxt(GetDlgItem(IDC_CMB_COPY_DEPTH_BUFFER), tooltip.c_str());
tooltip = wGS(FRAMEBUFFER_N64_DEPTH_COMPARE_TOOLTIP);
TTSetTxt(GetDlgItem(IDC_TXT_N64_DEPTH_COMPARE), tooltip.c_str());
TTSetTxt(GetDlgItem(IDC_CMB_N64_DEPTH_COMPARE), tooltip.c_str());
tooltip = wGS(FRAMEBUFFER_FORCE_DEPTH_BUFFER_CLEAR_TOOLTIP);
TTSetTxt(GetDlgItem(IDC_CHK_FORCE_DEPTH_BUFFER_CLEAR), tooltip.c_str());
tooltip = wGS(FRAMEBUFFER_RENDER_FRAMEBUFFER_TOOLTIP);
TTSetTxt(GetDlgItem(IDC_CHK_RENDER_FRAMEBUFFER), tooltip.c_str());
tooltip = wGS(FRAMEBUFFER_COPY_DEPTH_TO_MAIN_TOOLTIP);
TTSetTxt(GetDlgItem(IDC_CHK_COPY_DEPTH_TO_MAIN_DEPTH_BUFFER), tooltip.c_str());
CComboBox frameBufferSwapComboBox(GetDlgItem(IDC_CMB_FRAMEBUFFER_SWAP));
int selectedIndx = frameBufferSwapComboBox.GetCurSel();
frameBufferSwapComboBox.ResetContent();
frameBufferSwapComboBox.AddString(wGS(FRAMEBUFFER_VERTICAL_INTERRUPT).c_str());
frameBufferSwapComboBox.AddString(wGS(FRAMEBUFFER_VI_ORIGIN_CHANGE).c_str());
frameBufferSwapComboBox.AddString(wGS(FRAMEBUFFER_COLOR_BUFFER_CHANGE).c_str());
if (selectedIndx >= 0)
frameBufferSwapComboBox.SetCurSel(selectedIndx);
CComboBox copyColorBufferComboBox(GetDlgItem(IDC_CMB_COPY_COLOR_BUFFER));
selectedIndx = copyColorBufferComboBox.GetCurSel();
copyColorBufferComboBox.ResetContent();
copyColorBufferComboBox.AddString(wGS(FRAMEBUFFER_COPY_NEVER).c_str());
copyColorBufferComboBox.AddString(wGS(FRAMEBUFFER_COPY_SYNCHRONOUS).c_str());
copyColorBufferComboBox.AddString(wGS(FRAMEBUFFER_COPY_ASYNCHRONOUS).c_str());
if (selectedIndx >= 0)
copyColorBufferComboBox.SetCurSel(selectedIndx);
CComboBox copyDepthBufferComboBox(GetDlgItem(IDC_CMB_COPY_DEPTH_BUFFER));
selectedIndx = copyDepthBufferComboBox.GetCurSel();
copyDepthBufferComboBox.ResetContent();
copyDepthBufferComboBox.AddString(wGS(FRAMEBUFFER_COPY_DEPTH_NEVER).c_str());
copyDepthBufferComboBox.AddString(wGS(FRAMEBUFFER_COPY_DEPTH_VRAM).c_str());
copyDepthBufferComboBox.AddString(wGS(FRAMEBUFFER_COPY_DEPTH_SOFTWARE).c_str());
if (selectedIndx >= 0)
copyDepthBufferComboBox.SetCurSel(selectedIndx);
CComboBox n64DepthCompareComboBox(GetDlgItem(IDC_CMB_N64_DEPTH_COMPARE));
selectedIndx = n64DepthCompareComboBox.GetCurSel();
n64DepthCompareComboBox.ResetContent();
n64DepthCompareComboBox.AddString(wGS(FRAMEBUFFER_N64_DEPTH_DISABLE).c_str());
n64DepthCompareComboBox.AddString(wGS(FRAMEBUFFER_N64_DEPTH_FAST).c_str());
n64DepthCompareComboBox.AddString(wGS(FRAMEBUFFER_N64_DEPTH_COMPATIBLE).c_str());
if (selectedIndx >= 0)
n64DepthCompareComboBox.SetCurSel(selectedIndx);
}
LRESULT CFrameBufferTab::OnColorStatic(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
return (LRESULT)GetStockObject(WHITE_BRUSH);
}
LRESULT CFrameBufferTab::OnEnableFramebuffer(UINT /*Code*/, int /*id*/, HWND /*ctl*/)
{
bool fbEmulationEnabled = CButton(GetDlgItem(IDC_CHK_ENABLE_FRAMEBUFFER)).GetCheck() == BST_CHECKED;
bool fbInfoEnabled = CButton(GetDlgItem(IDC_CHK_FB_INFO_ENABLE)).GetCheck() == BST_CHECKED;
CButton(GetDlgItem(IDC_CHK_COPY_AUX_BUFFERS)).EnableWindow(fbEmulationEnabled);
CButton(GetDlgItem(IDC_CMB_FRAMEBUFFER_SWAP)).EnableWindow(fbEmulationEnabled);
CButton(GetDlgItem(IDC_CHK_FB_INFO_ENABLE)).EnableWindow(fbEmulationEnabled);
CButton(GetDlgItem(IDC_CMB_COPY_COLOR_BUFFER)).EnableWindow(fbEmulationEnabled);
CButton(GetDlgItem(IDC_CMB_COPY_DEPTH_BUFFER)).EnableWindow(fbEmulationEnabled);
CButton(GetDlgItem(IDC_CMB_N64_DEPTH_COMPARE)).EnableWindow(fbEmulationEnabled);
CButton(GetDlgItem(IDC_CHK_FORCE_DEPTH_BUFFER_CLEAR)).EnableWindow(fbEmulationEnabled);
CButton(GetDlgItem(IDC_CHK_RENDER_FRAMEBUFFER)).EnableWindow(fbEmulationEnabled);
CButton(GetDlgItem(IDC_CHK_COPY_DEPTH_TO_MAIN_DEPTH_BUFFER)).EnableWindow(fbEmulationEnabled);
CButton(GetDlgItem(IDC_CHK_READ_COLOR_CHUNK)).EnableWindow(fbEmulationEnabled && fbInfoEnabled);
CButton(GetDlgItem(IDC_CHK_READ_DEPTH_CHUNK)).EnableWindow(fbEmulationEnabled && fbInfoEnabled);
return 0;
}
LRESULT CFrameBufferTab::OnFbInfoEnable(UINT /*Code*/, int /*id*/, HWND /*ctl*/)
{
bool fbInfoEnabled = CButton(GetDlgItem(IDC_CHK_FB_INFO_ENABLE)).GetCheck() == BST_CHECKED;
CButton(GetDlgItem(IDC_CHK_READ_COLOR_CHUNK)).EnableWindow(fbInfoEnabled);
CButton(GetDlgItem(IDC_CHK_READ_DEPTH_CHUNK)).EnableWindow(fbInfoEnabled);
return 0;
}
void CFrameBufferTab::LoadSettings(bool /*blockCustomSettings*/)
{
const bool fbEmulationEnabled = config.frameBufferEmulation.enable != 0;
CButton(GetDlgItem(IDC_CHK_ENABLE_FRAMEBUFFER)).SetCheck(fbEmulationEnabled != 0 ? BST_CHECKED : BST_UNCHECKED);
CButton(GetDlgItem(IDC_CHK_COPY_AUX_BUFFERS)).SetCheck(config.frameBufferEmulation.copyAuxToRDRAM != 0 ? BST_CHECKED : BST_UNCHECKED);
CComboBox(GetDlgItem(IDC_CMB_FRAMEBUFFER_SWAP)).SetCurSel(config.frameBufferEmulation.bufferSwapMode);
CButton(GetDlgItem(IDC_CHK_FB_INFO_ENABLE)).SetCheck(config.frameBufferEmulation.fbInfoDisabled == 0 ? BST_CHECKED : BST_UNCHECKED);
CButton(GetDlgItem(IDC_CHK_READ_COLOR_CHUNK)).SetCheck(config.frameBufferEmulation.fbInfoReadColorChunk != 0 ? BST_CHECKED : BST_UNCHECKED);
CButton(GetDlgItem(IDC_CHK_READ_DEPTH_CHUNK)).SetCheck(config.frameBufferEmulation.fbInfoReadDepthChunk != 0 ? BST_CHECKED : BST_UNCHECKED);
CComboBox(GetDlgItem(IDC_CMB_COPY_COLOR_BUFFER)).SetCurSel(config.frameBufferEmulation.copyToRDRAM);
CComboBox(GetDlgItem(IDC_CMB_COPY_DEPTH_BUFFER)).SetCurSel(config.frameBufferEmulation.copyDepthToRDRAM);
CComboBox(GetDlgItem(IDC_CMB_N64_DEPTH_COMPARE)).SetCurSel(config.frameBufferEmulation.N64DepthCompare);
CButton(GetDlgItem(IDC_CHK_FORCE_DEPTH_BUFFER_CLEAR)).SetCheck(config.frameBufferEmulation.forceDepthBufferClear != 0 ? BST_CHECKED : BST_UNCHECKED);
CButton(GetDlgItem(IDC_CHK_RENDER_FRAMEBUFFER)).SetCheck(config.frameBufferEmulation.copyFromRDRAM != 0 ? BST_CHECKED : BST_UNCHECKED);
CButton(GetDlgItem(IDC_CHK_COPY_DEPTH_TO_MAIN_DEPTH_BUFFER)).SetCheck(config.frameBufferEmulation.copyDepthToMainDepthBuffer != 0 ? BST_CHECKED : BST_UNCHECKED);
OnFbInfoEnable(0, 0, NULL);
OnEnableFramebuffer(0, 0, NULL);
}
void CFrameBufferTab::SaveSettings()
{
config.frameBufferEmulation.enable = CButton(GetDlgItem(IDC_CHK_ENABLE_FRAMEBUFFER)).GetCheck() == BST_CHECKED ? 1 : 0;
config.frameBufferEmulation.copyAuxToRDRAM = CButton(GetDlgItem(IDC_CHK_COPY_AUX_BUFFERS)).GetCheck() == BST_CHECKED ? 1 : 0;
config.frameBufferEmulation.bufferSwapMode = CComboBox(GetDlgItem(IDC_CMB_FRAMEBUFFER_SWAP)).GetCurSel();
config.frameBufferEmulation.fbInfoDisabled = CButton(GetDlgItem(IDC_CHK_FB_INFO_ENABLE)).GetCheck() == BST_CHECKED ? 0 : 1;
config.frameBufferEmulation.fbInfoReadColorChunk = CButton(GetDlgItem(IDC_CHK_READ_COLOR_CHUNK)).GetCheck() == BST_CHECKED ? 1 : 0;
config.frameBufferEmulation.fbInfoReadDepthChunk = CButton(GetDlgItem(IDC_CHK_READ_DEPTH_CHUNK)).GetCheck() == BST_CHECKED ? 1 : 0;
config.frameBufferEmulation.copyToRDRAM = CComboBox(GetDlgItem(IDC_CMB_COPY_COLOR_BUFFER)).GetCurSel();
config.frameBufferEmulation.copyDepthToRDRAM = CComboBox(GetDlgItem(IDC_CMB_COPY_DEPTH_BUFFER)).GetCurSel();
config.frameBufferEmulation.N64DepthCompare = CComboBox(GetDlgItem(IDC_CMB_N64_DEPTH_COMPARE)).GetCurSel();
config.frameBufferEmulation.forceDepthBufferClear = CButton(GetDlgItem(IDC_CHK_FORCE_DEPTH_BUFFER_CLEAR)).GetCheck() == BST_CHECKED ? 1 : 0;
config.frameBufferEmulation.copyFromRDRAM = CButton(GetDlgItem(IDC_CHK_RENDER_FRAMEBUFFER)).GetCheck() == BST_CHECKED ? 1 : 0;
config.frameBufferEmulation.copyDepthToMainDepthBuffer = CButton(GetDlgItem(IDC_CHK_COPY_DEPTH_TO_MAIN_DEPTH_BUFFER)).GetCheck() == BST_CHECKED ? 1 : 0;
}

View File

@ -1,33 +0,0 @@
#pragma once
#include "config-tab.h"
#include "wtl-BitmapPicture.h"
#include "wtl-tooltip.h"
#include "resource.h"
class CFrameBufferTab :
public CConfigTab,
public CToolTipDialog<CFrameBufferTab>
{
public:
BEGIN_MSG_MAP(CFrameBufferTab)
MSG_WM_INITDIALOG(OnInitDialog)
MESSAGE_HANDLER(WM_CTLCOLORDLG, OnColorStatic)
MESSAGE_HANDLER(WM_CTLCOLORSTATIC, OnColorStatic)
COMMAND_HANDLER_EX(IDC_CHK_ENABLE_FRAMEBUFFER, BN_CLICKED, OnEnableFramebuffer)
COMMAND_HANDLER_EX(IDC_CHK_FB_INFO_ENABLE, BN_CLICKED, OnFbInfoEnable)
CHAIN_MSG_MAP(CToolTipDialog<CFrameBufferTab>)
END_MSG_MAP()
CFrameBufferTab();
BOOL OnInitDialog(CWindow /*wndFocus*/, LPARAM /*lInitParam*/);
LRESULT OnColorStatic(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
LRESULT OnEnableFramebuffer(UINT /*Code*/, int id, HWND /*ctl*/);
LRESULT OnFbInfoEnable(UINT /*Code*/, int id, HWND /*ctl*/);
void ApplyLanguage(void);
void LoadSettings(bool blockCustomSettings);
void SaveSettings();
private:
CBitmapPicture m_EmulateFBIcon;
};

View File

@ -1,309 +0,0 @@
#include "config-osd.h"
#include "resource.h"
#include "util/util.h"
#include "../Config.h"
#include "FontInfo.h"
#include "Language.h"
COsdTab::COsdTab() :
CConfigTab(IDD_TAB_OSD),
m_PosTopLeft(IDI_OSD_TOP_LEFT),
m_PosTop(IDI_OSD_TOP),
m_PosTopRight(IDI_OSD_TOP_RIGHT),
m_PosCenterLeft(IDI_OSD_LEFT),
m_PosCenter(0),
m_PosCenterRight(IDI_OSD_RIGHT),
m_PosBottomLeft(IDI_OSD_BOTTOM_LEFT),
m_PosBottom(IDI_OSD_BOTTOM),
m_PosBottomRight(IDI_OSD_BOTTOM_RIGHT)
{
m_FontsLoaded = false;
}
BOOL COsdTab::OnInitDialog(CWindow /*wndFocus*/, LPARAM /*lInitParam*/)
{
m_PosTopLeft.SubclassWindow(GetDlgItem(IDC_OSD_TOP_LEFT));
m_PosTop.SubclassWindow(GetDlgItem(IDC_OSD_TOP));
m_PosTopRight.SubclassWindow(GetDlgItem(IDC_OSD_TOP_RIGHT));
m_PosCenterLeft.SubclassWindow(GetDlgItem(IDC_OSD_CENTER_LEFT));
m_PosCenter.SubclassWindow(GetDlgItem(IDC_OSD_CENTER));
m_PosCenterRight.SubclassWindow(GetDlgItem(IDC_OSD_CENTER_RIGHT));
m_PosBottomLeft.SubclassWindow(GetDlgItem(IDC_OSD_BOTTOM_LEFT));
m_PosBottom.SubclassWindow(GetDlgItem(IDC_OSD_BOTTOM));
m_PosBottomRight.SubclassWindow(GetDlgItem(IDC_OSD_BOTTOM_RIGHT));
m_Fonts.Attach(GetDlgItem(IDC_FONTS));
m_OsdColor.SubclassWindow(GetDlgItem(IDC_OSD_COLOR));
m_OsdPreview.SubclassWindow(GetDlgItem(IDC_OSD_PREVIEW));
m_FontSizeTxt.Attach(GetDlgItem(IDC_FONT_SIZE_TXT));
m_FontSizeSpin.Attach(GetDlgItem(IDC_FONT_SIZE_SPIN));
m_FontSizeSpin.SetBase(10);
m_FontSizeSpin.SetRange(6, 99);
m_FontSizeSpin.SetBuddy(m_FontSizeTxt);
m_PosCenterLeft.EnableWindow(false);
m_PosCenter.EnableWindow(false);
m_PosCenterRight.EnableWindow(false);
return true;
}
void COsdTab::LoadFonts(void)
{
FontList fonts = GetFontFiles();
HTREEITEM hCurrentItem = TVI_ROOT;
for (FontList::const_iterator itr = fonts.begin(); itr != fonts.end(); itr++) {
std::wstring FontFile = ToUTF16(itr->first.c_str());
std::wstring FontName = ToUTF16(itr->second.c_str());
TVINSERTSTRUCT tv = { 0 };
wchar_t Item[500];
tv.item.mask = TVIF_TEXT;
tv.item.pszText = Item;
tv.item.cchTextMax = sizeof(Item) / sizeof(Item[0]);
tv.item.hItem = m_Fonts.GetChildItem(TVI_ROOT);
HTREEITEM hParent = TVI_ROOT;
while (tv.item.hItem) {
m_Fonts.GetItem(&tv.item);
if (wcscmp(FontName.c_str(), Item) == 0) {
hParent = tv.item.hItem;
break;
}
tv.item.hItem = m_Fonts.GetNextSiblingItem(tv.item.hItem);
}
if (hParent == TVI_ROOT) {
tv.item.mask = TVIF_TEXT;
tv.item.pszText = (LPWSTR)FontName.c_str();
tv.item.cchTextMax = static_cast<int>(FontName.length());
tv.hInsertAfter = TVI_SORT;
tv.hParent = TVI_ROOT;
hParent = m_Fonts.InsertItem(&tv);
}
tv.item.mask = TVIF_TEXT;
tv.item.pszText = (LPWSTR)FontFile.c_str();
tv.item.cchTextMax = static_cast<int>(FontFile.length());
tv.hInsertAfter = TVI_SORT;
tv.hParent = hParent;
m_Fonts.InsertItem(&tv);
}
if (hCurrentItem != TVI_ROOT) {
m_Fonts.SelectItem(hCurrentItem);
m_Fonts.SetItemState(hCurrentItem, TVIF_STATE | TVIS_SELECTED, TVIF_STATE | TVIS_SELECTED);
m_Fonts.SetFocus();
}
m_FontsLoaded = true;
SelCurrentFont();
}
void COsdTab::SelCurrentFont(void)
{
std::wstring CurrentFile = ToUTF16(config.font.name.c_str());
TVINSERTSTRUCT tv = { 0 };
wchar_t Item[500];
tv.item.mask = TVIF_TEXT;
tv.item.pszText = Item;
tv.item.cchTextMax = sizeof(Item) / sizeof(Item[0]);
tv.item.hItem = m_Fonts.GetChildItem(TVI_ROOT);
HTREEITEM hCurrentItem = NULL;
while (tv.item.hItem) {
m_Fonts.GetItem(&tv.item);
m_Fonts.SetItemState(tv.item.hItem, 0, TVIF_STATE | TVIS_SELECTED);
HTREEITEM hChild = m_Fonts.GetChildItem(tv.item.hItem);
HTREEITEM NextItem = m_Fonts.GetNextSiblingItem(tv.item.hItem);
if (hChild != NULL) {
tv.item.hItem = hChild;
while (tv.item.hItem) {
m_Fonts.GetItem(&tv.item);
m_Fonts.SetItemState(tv.item.hItem, 0, TVIF_STATE | TVIS_SELECTED);
if (Item == CurrentFile)
hCurrentItem = tv.item.hItem;
tv.item.hItem = m_Fonts.GetNextSiblingItem(tv.item.hItem);
}
}
tv.item.hItem = NextItem;
}
if (hCurrentItem != TVI_ROOT) {
m_Fonts.SelectItem(hCurrentItem);
m_Fonts.SetItemState(hCurrentItem, TVIF_STATE | TVIS_SELECTED, TVIF_STATE | TVIS_SELECTED);
m_Fonts.SetFocus();
}
}
void COsdTab::ApplyLanguage(void)
{
SetDlgItemTextW(IDC_POSITION, wGS(OSD_POSITION).c_str());
SetDlgItemTextW(IDC_CHK_FPS, wGS(OSD_DISPLAY_FPS).c_str());
SetDlgItemTextW(IDC_CHK_VIS, wGS(OSD_DISPLAY_VI).c_str());
SetDlgItemTextW(IDC_CHK_PERCENT, wGS(OSD_DISPLAY_PERCENTAGE).c_str());
SetDlgItemTextW(IDC_INTERNAL_RESOLUTION, wGS(OSD_DISPLAY_INTERNAL_RESOLUTION).c_str());
SetDlgItemTextW(IDC_RENDERING_RESOLUTION, wGS(OSD_DISPLAY_RENDERING_RESOLUTION).c_str());
SetDlgItemTextW(IDC_FONT, wGS(OSD_FONT).c_str());
SetDlgItemTextW(IDC_TXT_SIZE, wGS(OSD_SIZE).c_str());
SetDlgItemTextW(IDC_PX, wGS(OSD_PX).c_str());
SetDlgItemTextW(IDC_COLOR, wGS(OSD_COLOR).c_str());
}
LRESULT COsdTab::OnScroll(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/)
{
LONG CtrlId = CWindow((HWND)lParam).GetWindowLong(GWL_ID);
if (CtrlId == IDC_FONT_SIZE_SPIN)
m_OsdPreview.SetFontSize(m_FontSizeSpin.GetPos());
return 0;
}
void COsdTab::ClearOsdChecked()
{
m_PosTopLeft.SetChecked(false);
m_PosTopLeft.Invalidate();
m_PosTop.SetChecked(false);
m_PosTop.Invalidate();
m_PosTopRight.SetChecked(false);
m_PosTopRight.Invalidate();
m_PosBottomLeft.SetChecked(false);
m_PosBottomLeft.Invalidate();
m_PosBottom.SetChecked(false);
m_PosBottom.Invalidate();
m_PosBottomRight.SetChecked(false);
m_PosBottomRight.Invalidate();
}
LRESULT COsdTab::OnOsdTopLeft(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
ClearOsdChecked();
m_PosTopLeft.SetChecked(true);
return 0;
}
LRESULT COsdTab::OnOsdTop(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
ClearOsdChecked();
m_PosTop.SetChecked(true);
return 0;
}
LRESULT COsdTab::OnOsdTopRight(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
ClearOsdChecked();
m_PosTopRight.SetChecked(true);
return 0;
}
LRESULT COsdTab::OnOsdBottomLeft(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
ClearOsdChecked();
m_PosBottomLeft.SetChecked(true);
return 0;
}
LRESULT COsdTab::OnOsdBottom(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
ClearOsdChecked();
m_PosBottom.SetChecked(true);
return 0;
}
LRESULT COsdTab::OnOsdBottomRight(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
ClearOsdChecked();
m_PosBottomRight.SetChecked(true);
return 0;
}
LRESULT COsdTab::OnFontItemChanged(NMHDR* /*phdr*/)
{
m_OsdPreview.SetFont(GetSelectedFont());
return 0;
}
LRESULT COsdTab::OnColorStatic(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
return (LRESULT)GetStockObject(WHITE_BRUSH);
}
LRESULT COsdTab::OnNotifyOsdColor(LPNMHDR /*pnmh*/)
{
m_OsdPreview.SetColor(m_OsdColor.Red(), m_OsdColor.Green(), m_OsdColor.Blue());
m_OsdPreview.Invalidate();
return 0;
}
void COsdTab::LoadSettings(bool /*blockCustomSettings*/)
{
m_FontSizeTxt.SetWindowText(FormatStrW(L"%d", config.font.size).c_str());
if (config.font.size > 0) {
m_FontSizeSpin.SetPos(config.font.size);
m_OsdPreview.SetFontSize(config.font.size);
}
if (!(config.font.color[0] == NULL && config.font.color[1] == NULL && config.font.color[2] == NULL)) {
m_OsdColor.SetColor(config.font.color[0], config.font.color[1], config.font.color[2]);
m_OsdPreview.SetColor(config.font.color[0], config.font.color[1], config.font.color[2]);
}
m_PosTopLeft.SetChecked(config.onScreenDisplay.pos == Config::posTopLeft);
m_PosTop.SetChecked(config.onScreenDisplay.pos == Config::posTopCenter);
m_PosTopRight.SetChecked(config.onScreenDisplay.pos == Config::posTopRight);
m_PosBottomLeft.SetChecked(config.onScreenDisplay.pos == Config::posBottomLeft);
m_PosBottom.SetChecked(config.onScreenDisplay.pos == Config::posBottomCenter);
m_PosBottomRight.SetChecked(config.onScreenDisplay.pos == Config::posBottomRight);
CButton(GetDlgItem(IDC_CHK_FPS)).SetCheck(config.onScreenDisplay.fps != 0 ? BST_CHECKED : BST_UNCHECKED);
CButton(GetDlgItem(IDC_CHK_VIS)).SetCheck(config.onScreenDisplay.vis != 0 ? BST_CHECKED : BST_UNCHECKED);
CButton(GetDlgItem(IDC_CHK_PERCENT)).SetCheck(config.onScreenDisplay.percent != 0 ? BST_CHECKED : BST_UNCHECKED);
CButton(GetDlgItem(IDC_INTERNAL_RESOLUTION)).SetCheck(config.onScreenDisplay.internalResolution != 0 ? BST_CHECKED : BST_UNCHECKED);
CButton(GetDlgItem(IDC_RENDERING_RESOLUTION)).SetCheck(config.onScreenDisplay.renderingResolution != 0 ? BST_CHECKED : BST_UNCHECKED);
CButton(GetDlgItem(IDC_STATISTICS)).SetCheck(config.onScreenDisplay.statistics != 0 ? BST_CHECKED : BST_UNCHECKED);
if (m_FontsLoaded)
SelCurrentFont();
}
void COsdTab::SaveSettings()
{
if (m_PosTopLeft.isChecked()) { config.onScreenDisplay.pos = Config::posTopLeft; }
else if (m_PosTop.isChecked()) { config.onScreenDisplay.pos = Config::posTopCenter; }
else if (m_PosTopRight.isChecked()) { config.onScreenDisplay.pos = Config::posTopRight; }
else if (m_PosBottomLeft.isChecked()) { config.onScreenDisplay.pos = Config::posBottomLeft; }
else if (m_PosBottom.isChecked()) { config.onScreenDisplay.pos = Config::posBottomCenter; }
else if (m_PosBottomRight.isChecked()) { config.onScreenDisplay.pos = Config::posBottomRight; }
config.onScreenDisplay.fps = CButton(GetDlgItem(IDC_CHK_FPS)).GetCheck() == BST_CHECKED ? 1 : 0;
config.onScreenDisplay.vis = CButton(GetDlgItem(IDC_CHK_VIS)).GetCheck() == BST_CHECKED ? 1 : 0;
config.onScreenDisplay.percent = CButton(GetDlgItem(IDC_CHK_PERCENT)).GetCheck() == BST_CHECKED ? 1 : 0;
config.onScreenDisplay.internalResolution = CButton(GetDlgItem(IDC_INTERNAL_RESOLUTION)).GetCheck() == BST_CHECKED ? 1 : 0;
config.onScreenDisplay.renderingResolution = CButton(GetDlgItem(IDC_RENDERING_RESOLUTION)).GetCheck() == BST_CHECKED ? 1 : 0;
config.onScreenDisplay.statistics = CButton(GetDlgItem(IDC_STATISTICS)).GetCheck() == BST_CHECKED ? 1 : 0;
std::string SelectedFont = FromUTF16(GetSelectedFont().c_str());
if (!SelectedFont.empty())
config.font.name = SelectedFont;
if (config.font.name.empty())
config.font.name = "arial.ttf";
config.font.size = m_FontSizeSpin.GetPos();
config.font.color[0] = m_OsdColor.Red();
config.font.color[1] = m_OsdColor.Green();
config.font.color[2] = m_OsdColor.Blue();
config.font.color[3] = 0;
config.font.colorf[0] = (float)m_OsdColor.Red();
config.font.colorf[1] = (float)m_OsdColor.Green();
config.font.colorf[2] = (float)m_OsdColor.Blue();
config.font.colorf[3] = 0.0f;
}
std::wstring COsdTab::GetSelectedFont()
{
if (!m_FontsLoaded)
return ToUTF16(config.font.name.c_str());
HTREEITEM hItem = m_Fonts.GetSelectedItem();
if (hItem == NULL)
return L"";
HTREEITEM hChild = m_Fonts.GetChildItem(hItem);
if (hChild != NULL)
hItem = hChild;
wchar_t ItemText[MAX_PATH];
if (!m_Fonts.GetItemText(hItem, ItemText, sizeof(ItemText) / sizeof(ItemText[0])))
return L"";
return std::wstring(ItemText);
}

View File

@ -1,61 +0,0 @@
#pragma once
#include "config-tab.h"
#include "wtl-OsdButton.h"
#include "wtl-ColorButton.h"
#include "wtl-OsdPreview.h"
#include "resource.h"
#include <string>
class COsdTab :
public CConfigTab
{
public:
BEGIN_MSG_MAP(COsdTab)
MSG_WM_INITDIALOG(OnInitDialog)
NOTIFY_HANDLER_EX(IDC_FONTS, TVN_SELCHANGED, OnFontItemChanged)
MESSAGE_HANDLER(WM_CTLCOLORDLG, OnColorStatic)
MESSAGE_HANDLER(WM_CTLCOLORSTATIC, OnColorStatic)
MESSAGE_HANDLER(WM_VSCROLL, OnScroll)
COMMAND_ID_HANDLER(IDC_OSD_TOP_LEFT, OnOsdTopLeft)
COMMAND_ID_HANDLER(IDC_OSD_TOP, OnOsdTop)
COMMAND_ID_HANDLER(IDC_OSD_TOP_RIGHT, OnOsdTopRight)
COMMAND_ID_HANDLER(IDC_OSD_BOTTOM_LEFT, OnOsdBottomLeft)
COMMAND_ID_HANDLER(IDC_OSD_BOTTOM, OnOsdBottom)
COMMAND_ID_HANDLER(IDC_OSD_BOTTOM_RIGHT, OnOsdBottomRight)
NOTIFY_HANDLER_EX(IDC_OSD_COLOR, CColorButton::CPN_SELCHANGE, OnNotifyOsdColor)
REFLECT_NOTIFICATIONS()
END_MSG_MAP()
COsdTab();
bool m_FontsLoaded;
BOOL OnInitDialog(CWindow /*wndFocus*/, LPARAM /*lInitParam*/);
LRESULT OnScroll(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/);
void ClearOsdChecked();
LRESULT OnOsdTopLeft(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
LRESULT OnOsdTop(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
LRESULT OnOsdTopRight(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
LRESULT OnOsdBottomLeft(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
LRESULT OnOsdBottom(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
LRESULT OnOsdBottomRight(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
LRESULT OnFontItemChanged(NMHDR* /*phdr*/);
LRESULT OnColorStatic(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
LRESULT OnNotifyOsdColor(LPNMHDR pnmh);
void ApplyLanguage(void);
void LoadFonts(void);
void SelCurrentFont(void);
void LoadSettings(bool blockCustomSettings);
void SaveSettings();
private:
std::wstring GetSelectedFont();
COSDButton m_PosTopLeft, m_PosTop, m_PosTopRight;
COSDButton m_PosCenterLeft, m_PosCenter, m_PosCenterRight;
COSDButton m_PosBottomLeft, m_PosBottom, m_PosBottomRight;
CTreeViewCtrl m_Fonts;
CEdit m_FontSizeTxt;
CUpDownCtrl m_FontSizeSpin;
CColorButton m_OsdColor;
COsdPreview m_OsdPreview;
};

View File

@ -1,61 +0,0 @@
#include "config-overscan.h"
#include "util/util.h"
#include "resource.h"
COverScanTab::COverScanTab()
{
IDD = IDD_TAB_OVERSCAN;
}
BOOL COverScanTab::OnInitDialog(CWindow /*wndFocus*/, LPARAM /*lInitParam*/)
{
m_LeftTxt.Attach(GetDlgItem(IDC_OVERSCAN_LEFT_TXT));
m_LeftSpin.Attach(GetDlgItem(IDC_OVERSCAN_LEFT_SPIN));
m_LeftSpin.SetBase(10);
m_LeftSpin.SetRange(-99, 99);
m_LeftSpin.SetBuddy(m_LeftTxt);
m_RightTxt.Attach(GetDlgItem(IDC_OVERSCAN_RIGHT_TXT));
m_RightSpin.Attach(GetDlgItem(IDC_OVERSCAN_RIGHT_SPIN));
m_RightSpin.SetBase(10);
m_RightSpin.SetRange(-99, 99);
m_RightSpin.SetBuddy(m_RightTxt);
m_TopTxt.Attach(GetDlgItem(IDC_OVERSCAN_TOP_TXT));
m_TopSpin.Attach(GetDlgItem(IDC_OVERSCAN_TOP_SPIN));
m_TopSpin.SetBase(10);
m_TopSpin.SetRange(-99, 99);
m_TopSpin.SetBuddy(m_TopTxt);
m_BottomTxt.Attach(GetDlgItem(IDC_OVERSCAN_BOTTOM_TXT));
m_BottomSpin.Attach(GetDlgItem(IDC_OVERSCAN_BOTTOM_SPIN));
m_BottomSpin.SetBase(10);
m_BottomSpin.SetRange(-99, 99);
m_BottomSpin.SetBuddy(m_BottomTxt);
return true;
}
void COverScanTab::SetValue(int32_t Left, int32_t Right, int32_t Top, int32_t Bottom)
{
m_LeftTxt.SetWindowText(FormatStrW(L"%d", Left).c_str());
m_LeftSpin.SetPos(Left);
m_RightTxt.SetWindowText(FormatStrW(L"%d", Right).c_str());
m_RightSpin.SetPos(Right);
m_TopTxt.SetWindowText(FormatStrW(L"%d", Top).c_str());
m_TopSpin.SetPos(Top);
m_BottomTxt.SetWindowText(FormatStrW(L"%d", Bottom).c_str());
m_BottomSpin.SetPos(Bottom);
}
void COverScanTab::GetValue(int32_t & Left, int32_t & Right, int32_t & Top, int32_t & Bottom)
{
Left = m_LeftSpin.GetPos();
Right = m_RightSpin.GetPos();
Top = m_TopSpin.GetPos();
Bottom = m_BottomSpin.GetPos();
}
LRESULT COverScanTab::OnColorStatic(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
return (LRESULT)GetStockObject(WHITE_BRUSH);
}

View File

@ -1,27 +0,0 @@
#pragma once
#include <stdint.h>
#include "wtl.h"
class COverScanTab :
public CDialogImpl<COverScanTab>
{
public:
uint32_t IDD;
BEGIN_MSG_MAP(CAboutCreditsTab)
MSG_WM_INITDIALOG(OnInitDialog)
MESSAGE_HANDLER(WM_CTLCOLORDLG, OnColorStatic)
MESSAGE_HANDLER(WM_CTLCOLORSTATIC, OnColorStatic)
END_MSG_MAP()
COverScanTab();
BOOL OnInitDialog(CWindow wndFocus, LPARAM lInitParam);
void SetValue(int32_t Left, int32_t Right, int32_t Top, int32_t Bottom);
void GetValue(int32_t & Left, int32_t & Right, int32_t & Top, int32_t & Bottom);
LRESULT OnColorStatic(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
private:
CEdit m_LeftTxt, m_RightTxt, m_TopTxt, m_BottomTxt;
CUpDownCtrl m_LeftSpin, m_RightSpin, m_TopSpin, m_BottomSpin;
};

View File

@ -1,11 +0,0 @@
#include "config-tab.h"
CConfigTab::CConfigTab(uint32_t _IDD) :
IDD(_IDD)
{
}
CConfigTab::~CConfigTab()
{
}

View File

@ -1,20 +0,0 @@
#pragma once
#include <stdint.h>
#include "wtl.h"
class CConfigTab :
public CDialogImpl<CConfigTab>
{
public:
CConfigTab(uint32_t _IDD);
virtual ~CConfigTab();
BEGIN_MSG_MAP(CConfigTab)
END_MSG_MAP()
virtual void ApplyLanguage() = 0;
virtual void LoadSettings(bool blockCustomSettings) = 0;
virtual void SaveSettings() = 0;
uint32_t IDD;
};

View File

@ -1,305 +0,0 @@
#include "config-texture.h"
#include "resource.h"
#include "util/util.h"
#include "../Config.h"
#include "Language.h"
#include <Shlobj.h>
CTextureEnhancementTab::CTextureEnhancementTab() :
CConfigTab(IDD_TAB_TEXTURE_ENHANCEMENT)
{
}
BOOL CTextureEnhancementTab::OnInitDialog(CWindow /*wndFocus*/, LPARAM /*lInitParam*/)
{
TTInit();
TTSize(400);
CComboBox filterComboBox(GetDlgItem(IDC_CMB_FILTER));
filterComboBox.AddString(wGS(TEXTURE_N64_FILTER_NONE).c_str());
filterComboBox.AddString(wGS(TEXTURE_N64_FILTER_SMOOTH1).c_str());
filterComboBox.AddString(wGS(TEXTURE_N64_FILTER_SMOOTH2).c_str());
filterComboBox.AddString(wGS(TEXTURE_N64_FILTER_SMOOTH3).c_str());
filterComboBox.AddString(wGS(TEXTURE_N64_FILTER_SMOOTH4).c_str());
filterComboBox.AddString(wGS(TEXTURE_N64_FILTER_SHARP1).c_str());
filterComboBox.AddString(wGS(TEXTURE_N64_FILTER_SHARP2).c_str());
CComboBox enhancementComboBox(GetDlgItem(IDC_CMB_ENHANCEMENT));
enhancementComboBox.AddString(wGS(TEXTURE_ENHANCEMENT_NONE).c_str());
enhancementComboBox.AddString(wGS(TEXTURE_ENHANCEMENT_STORE).c_str());
enhancementComboBox.AddString(L"X2");
enhancementComboBox.AddString(L"X2SAI");
enhancementComboBox.AddString(L"HQ2X");
enhancementComboBox.AddString(L"HQ2XS");
enhancementComboBox.AddString(L"LQ2X");
enhancementComboBox.AddString(L"LQ2XS");
enhancementComboBox.AddString(L"HQ4X");
enhancementComboBox.AddString(L"2xBRZ");
enhancementComboBox.AddString(L"3xBRZ");
enhancementComboBox.AddString(L"4xBRZ");
enhancementComboBox.AddString(L"5xBRZ");
enhancementComboBox.AddString(L"6xBRZ");
m_TextureFilterCacheTxt.Attach(GetDlgItem(IDC_TEXTURE_FILTER_CACHE_EDIT));
m_TextureFilterCacheSpin.Attach(GetDlgItem(IDC_TEXTURE_FILTER_CACHE_SPIN));
m_TextureFilterCacheSpin.SetBase(10);
m_TextureFilterCacheSpin.SetRange(0, 20);
m_TextureFilterCacheSpin.SetPos(0);
m_TextureFilterCacheSpin.SetBuddy(m_TextureFilterCacheTxt);
return true;
}
void CTextureEnhancementTab::ApplyLanguage(void)
{
SetDlgItemTextW(IDC_TXT_N64_TEXTURE, wGS(TEXTURE_N64_TEXTURES_GROUP).c_str());
SetDlgItemTextW(IDC_TXT_TEXTURE_FILTER, wGS(TEXTURE_N64_FILTER).c_str());
SetDlgItemTextW(IDC_TXT_ENHANCEMENT, wGS(TEXTURE_ENHANCEMENT).c_str());
SetDlgItemTextW(IDC_CHK_DECREASE_COLOR, wGS(TEXTURE_DECREASE_COLOR).c_str());
SetDlgItemTextW(IDC_CHK_IGNORE_BACKGROUNDS, wGS(TEXTURE_IGNORE_BACKGROUNDS).c_str());
SetDlgItemTextW(IDC_CHK_ENHANCED_TEX_FILE_STORAGE, wGS(TEXTURE_USE_FILE_STORAGE).c_str());
SetDlgItemTextW(IDC_TEX_PACK_PATH_STATIC, wGS(TEXTURE_TEXTURE_PACK).c_str());
SetDlgItemTextW(IDC_TEX_CACHE_PATH_STATIC, wGS(TEXTURE_CACHE_PATH).c_str());
SetDlgItemTextW(IDC_TEX_DUMP_PATH_STATIC, wGS(TEXTURE_DUMP_PATH).c_str());
SetDlgItemTextW(IDC_CHK_ALPHA_CHANNEL, wGS(TEXTURE_USE_FULL_TRANSPARENCIES).c_str());
SetDlgItemTextW(IDC_CHK_ALTERNATIVE_CRC, wGS(TEXTURE_ALTERNATIVE_CRC).c_str());
SetDlgItemTextW(IDC_CHK_HIRES_TEX_FILESTORAGE, wGS(TEXTURE_USE_FILE_STORAGE).c_str());
SetDlgItemTextW(IDC_TEXTURE_FILTER_CACHE_STATIC, wGS(TEXTURE_SIZE_OF_MEMORY_CACHE).c_str());
SetDlgItemTextW(IDC_CHK_SAVE_TEXTURE_CACHE, wGS(TEXTURE_SAVE_ENHANCED).c_str());
SetDlgItemTextW(IDC_CHK_COMPRESS_CACHE, wGS(TEXTURE_COMPRESS_CACHE).c_str());
SetDlgItemTextW(IDC_CHK_FORCE_16BPP, wGS(TEXTURE_CONVERT_16BPP).c_str());
std::wstring tooltip = wGS(TEXTURE_N64_FILTER_TOOLTIP);
TTSetTxt(GetDlgItem(IDC_TXT_TEXTURE_FILTER), tooltip.c_str());
TTSetTxt(GetDlgItem(IDC_CMB_FILTER), tooltip.c_str());
tooltip = wGS(TEXTURE_ENHANCEMENT_TOOLTIP);
TTSetTxt(GetDlgItem(IDC_TXT_ENHANCEMENT), tooltip.c_str());
TTSetTxt(GetDlgItem(IDC_CMB_ENHANCEMENT), tooltip.c_str());
tooltip = wGS(TEXTURE_DECREASE_COLOR_TOOLTIP);
TTSetTxt(GetDlgItem(IDC_CHK_DECREASE_COLOR), tooltip.c_str());
tooltip = wGS(TEXTURE_IGNORE_BACKGROUNDS_TOOLTIP);
TTSetTxt(GetDlgItem(IDC_CHK_IGNORE_BACKGROUNDS), tooltip.c_str());
tooltip = wGS(TEXTURE_TEXTURE_PACK_TOOLTIP);
TTSetTxt(GetDlgItem(IDC_TEX_PACK_PATH_STATIC), tooltip.c_str());
TTSetTxt(GetDlgItem(IDC_TEX_PACK_PATH_EDIT), tooltip.c_str());
tooltip = wGS(TEXTURE_USE_FULL_TRANSPARENCIES_TOOLTIP);
TTSetTxt(GetDlgItem(IDC_CHK_ALPHA_CHANNEL), tooltip.c_str());
tooltip = wGS(TEXTURE_ALTERNATIVE_CRC_TOOLTIP);
TTSetTxt(GetDlgItem(IDC_CHK_ALTERNATIVE_CRC), tooltip.c_str());
tooltip = wGS(TEXTURE_USE_FILE_STORAGE_TOOLTIP);
TTSetTxt(GetDlgItem(IDC_CHK_HIRES_TEX_FILESTORAGE), tooltip.c_str());
tooltip = wGS(TEXTURE_SIZE_OF_MEMORY_CACHE_TOOLTIP);
TTSetTxt(GetDlgItem(IDC_TEXTURE_FILTER_CACHE_STATIC), tooltip.c_str());
TTSetTxt(GetDlgItem(IDC_TEXTURE_FILTER_CACHE_EDIT), tooltip.c_str());
tooltip = wGS(TEXTURE_SAVE_ENHANCED_TOOLTIP);
TTSetTxt(GetDlgItem(IDC_CHK_SAVE_TEXTURE_CACHE), tooltip.c_str());
tooltip = wGS(TEXTURE_COMPRESS_CACHE_TOOLTIP);
TTSetTxt(GetDlgItem(IDC_CHK_COMPRESS_CACHE), tooltip.c_str());
tooltip = wGS(TEXTURE_CONVERT_16BPP_TOOLTIP);
TTSetTxt(GetDlgItem(IDC_CHK_FORCE_16BPP), tooltip.c_str());
CComboBox filterComboBox(GetDlgItem(IDC_CMB_FILTER));
int selectedIndx = filterComboBox.GetCurSel();
filterComboBox.ResetContent();
filterComboBox.AddString(wGS(TEXTURE_N64_FILTER_NONE).c_str());
filterComboBox.AddString(wGS(TEXTURE_N64_FILTER_SMOOTH1).c_str());
filterComboBox.AddString(wGS(TEXTURE_N64_FILTER_SMOOTH2).c_str());
filterComboBox.AddString(wGS(TEXTURE_N64_FILTER_SMOOTH3).c_str());
filterComboBox.AddString(wGS(TEXTURE_N64_FILTER_SMOOTH4).c_str());
filterComboBox.AddString(wGS(TEXTURE_N64_FILTER_SHARP1).c_str());
filterComboBox.AddString(wGS(TEXTURE_N64_FILTER_SHARP2).c_str());
if (selectedIndx >= 0)
filterComboBox.SetCurSel(selectedIndx);
CComboBox enhancementComboBox(GetDlgItem(IDC_CMB_ENHANCEMENT));
selectedIndx = enhancementComboBox.GetCurSel();
enhancementComboBox.ResetContent();
enhancementComboBox.AddString(wGS(TEXTURE_ENHANCEMENT_NONE).c_str());
enhancementComboBox.AddString(wGS(TEXTURE_ENHANCEMENT_STORE).c_str());
enhancementComboBox.AddString(L"X2");
enhancementComboBox.AddString(L"X2SAI");
enhancementComboBox.AddString(L"HQ2X");
enhancementComboBox.AddString(L"HQ2XS");
enhancementComboBox.AddString(L"LQ2X");
enhancementComboBox.AddString(L"LQ2XS");
enhancementComboBox.AddString(L"HQ4X");
enhancementComboBox.AddString(L"2xBRZ");
enhancementComboBox.AddString(L"3xBRZ");
enhancementComboBox.AddString(L"4xBRZ");
enhancementComboBox.AddString(L"5xBRZ");
enhancementComboBox.AddString(L"6xBRZ");
if (selectedIndx >= 0)
enhancementComboBox.SetCurSel(selectedIndx);
}
LRESULT CTextureEnhancementTab::OnColorStatic(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
return (LRESULT)GetStockObject(WHITE_BRUSH);
}
void CTextureEnhancementTab::OnFileStorage(UINT /*Code*/, int /*id*/, HWND /*ctl*/)
{
bool UseFileStorage = !CButton(GetDlgItem(IDC_CHK_ENHANCED_TEX_FILE_STORAGE)).GetCheck() == BST_CHECKED;
CButton(GetDlgItem(IDC_TEXTURE_FILTER_CACHE_STATIC)).EnableWindow(UseFileStorage);
CButton(GetDlgItem(IDC_TEXTURE_FILTER_CACHE_EDIT)).EnableWindow(UseFileStorage);
CButton(GetDlgItem(IDC_TEXTURE_FILTER_CACHE_SPIN)).EnableWindow(UseFileStorage);
}
void CTextureEnhancementTab::OnTexturePack(UINT /*Code*/, int /*id*/, HWND /*ctl*/)
{
bool UseTextPack = CButton(GetDlgItem(IDC_CHK_TEXTURE_PACK)).GetCheck() == BST_CHECKED;
CButton(GetDlgItem(IDC_TEX_PACK_PATH_STATIC)).EnableWindow(UseTextPack);
CButton(GetDlgItem(IDC_TEX_PACK_PATH_EDIT)).EnableWindow(UseTextPack);
CButton(GetDlgItem(IDC_TEX_PACK_PATH_BTN)).EnableWindow(UseTextPack);
CButton(GetDlgItem(IDC_TEX_CACHE_PATH_STATIC)).EnableWindow(UseTextPack);
CButton(GetDlgItem(IDC_TEX_CACHE_PATH_EDIT)).EnableWindow(UseTextPack);
CButton(GetDlgItem(IDC_TEX_CACHE_PATH_BTN)).EnableWindow(UseTextPack);
CButton(GetDlgItem(IDC_TEX_DUMP_PATH_STATIC)).EnableWindow(UseTextPack);
CButton(GetDlgItem(IDC_TEX_DUMP_PATH_EDIT)).EnableWindow(UseTextPack);
CButton(GetDlgItem(IDC_TEX_DUMP_PATH_BTN)).EnableWindow(UseTextPack);
CButton(GetDlgItem(IDC_CHK_ALPHA_CHANNEL)).EnableWindow(UseTextPack);
CButton(GetDlgItem(IDC_CHK_ALTERNATIVE_CRC)).EnableWindow(UseTextPack);
CButton(GetDlgItem(IDC_CHK_HIRES_TEX_FILESTORAGE)).EnableWindow(UseTextPack);
}
LRESULT CTextureEnhancementTab::OnScroll(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/)
{
LONG CtrlId = CWindow((HWND)lParam).GetWindowLong(GWL_ID);
if (CtrlId == IDC_TEXTURE_FILTER_CACHE_SPIN) {
int Pos = m_TextureFilterCacheSpin.GetPos();
m_TextureFilterCacheTxt.SetWindowText(FormatStrW(L"%d MB", Pos == 20 ? 999 : Pos * 50).c_str());
}
return 0;
}
void CTextureEnhancementTab::LoadSettings(bool /*blockCustomSettings*/)
{
CComboBox(GetDlgItem(IDC_CMB_FILTER)).SetCurSel(config.textureFilter.txFilterMode);
CComboBox(GetDlgItem(IDC_CMB_ENHANCEMENT)).SetCurSel(config.textureFilter.txEnhancementMode);
CButton(GetDlgItem(IDC_CHK_DEPOSTERIZE)).SetCheck(config.textureFilter.txDeposterize != 0 ? BST_CHECKED : BST_UNCHECKED);
CButton(GetDlgItem(IDC_CHK_IGNORE_BACKGROUNDS)).SetCheck(config.textureFilter.txFilterIgnoreBG != 0 ? BST_CHECKED : BST_UNCHECKED);
CButton(GetDlgItem(IDC_CHK_ENHANCED_TEX_FILE_STORAGE)).SetCheck(config.textureFilter.txEnhancedTextureFileStorage != 0 ? BST_CHECKED : BST_UNCHECKED);
CButton(GetDlgItem(IDC_CHK_TEXTURE_PACK)).SetCheck(config.textureFilter.txHiresEnable != 0 ? BST_CHECKED : BST_UNCHECKED);
GetDlgItem(IDC_TEX_PACK_PATH_EDIT).SetWindowText(config.textureFilter.txPath);
GetDlgItem(IDC_TEX_CACHE_PATH_EDIT).SetWindowText(config.textureFilter.txCachePath);
GetDlgItem(IDC_TEX_DUMP_PATH_EDIT).SetWindowText(config.textureFilter.txDumpPath);
CButton(GetDlgItem(IDC_CHK_ALPHA_CHANNEL)).SetCheck(config.textureFilter.txHiresFullAlphaChannel != 0 ? BST_CHECKED : BST_UNCHECKED);
CButton(GetDlgItem(IDC_CHK_ALTERNATIVE_CRC)).SetCheck(config.textureFilter.txHresAltCRC != 0 ? BST_CHECKED : BST_UNCHECKED);
CButton(GetDlgItem(IDC_CHK_HIRES_TEX_FILESTORAGE)).SetCheck(config.textureFilter.txHiresTextureFileStorage != 0 ? BST_CHECKED : BST_UNCHECKED);
CButton(GetDlgItem(IDC_CHK_SAVE_TEXTURE_CACHE)).SetCheck(config.textureFilter.txSaveCache != 0 ? BST_CHECKED : BST_UNCHECKED);
CButton(GetDlgItem(IDC_CHK_COMPRESS_CACHE)).SetCheck(config.textureFilter.txCacheCompression != 0 ? BST_CHECKED : BST_UNCHECKED);
CButton(GetDlgItem(IDC_CHK_FORCE_16BPP)).SetCheck(config.textureFilter.txForce16bpp != 0 ? BST_CHECKED : BST_UNCHECKED);
m_TextureFilterCacheSpin.SetPos((config.textureFilter.txCacheSize / gc_uMegabyte) / 50);
OnFileStorage(0, 0, NULL);
OnTexturePack(0, 0, NULL);
BOOL bHandled;
OnScroll(0, 0, (LPARAM)(GetDlgItem(IDC_TEXTURE_FILTER_CACHE_SPIN).Detach()), bHandled);
}
void CTextureEnhancementTab::SaveDirectory(int EditCtrl, wchar_t * txPath)
{
CWindow EditWnd = GetDlgItem(EditCtrl);
int TxtLen = EditWnd.GetWindowTextLength();
std::wstring Path;
Path.resize(TxtLen + 1);
EditWnd.GetWindowTextW((wchar_t *)Path.data(), static_cast<int>(Path.size()));
bool exists = osal_path_existsW(Path.data());
if (!exists) {
if (osal_mkdirp(Path.data()) != 0) {
switch (EditCtrl) {
case IDC_TEX_PACK_PATH_EDIT:
MessageBox(L"Failed to create the texture pack folder. Please change the folder or turn off texture packs.", L"GLideN64", MB_OK | MB_ICONWARNING);
return;
case IDC_TEX_CACHE_PATH_EDIT:
MessageBox(L"Failed to create the texture pack cache folder. Please change the folder or turn off texture packs.", L"GLideN64", MB_OK | MB_ICONWARNING);
return;
case IDC_TEX_DUMP_PATH_EDIT:
MessageBox(L"Failed to create the texture dump folder. Please change the folder or turn off texture packs.", L"GLideN64", MB_OK | MB_ICONWARNING);
return;
default:
return;
}
}
}
wcscpy(txPath, Path.c_str());
}
void CTextureEnhancementTab::SaveSettings()
{
config.textureFilter.txFilterMode = CComboBox(GetDlgItem(IDC_CMB_FILTER)).GetCurSel();
config.textureFilter.txEnhancementMode = CComboBox(GetDlgItem(IDC_CMB_ENHANCEMENT)).GetCurSel();
config.textureFilter.txDeposterize = CButton(GetDlgItem(IDC_CHK_DEPOSTERIZE)).GetCheck() == BST_CHECKED ? 1 : 0;
config.textureFilter.txFilterIgnoreBG = CButton(GetDlgItem(IDC_CHK_IGNORE_BACKGROUNDS)).GetCheck() == BST_CHECKED ? 1 : 0;
config.textureFilter.txEnhancedTextureFileStorage = CButton(GetDlgItem(IDC_CHK_ENHANCED_TEX_FILE_STORAGE)).GetCheck() == BST_CHECKED ? 1 : 0;
config.textureFilter.txHiresEnable = CButton(GetDlgItem(IDC_CHK_TEXTURE_PACK)).GetCheck() == BST_CHECKED ? 1 : 0;
SaveDirectory(IDC_TEX_PACK_PATH_EDIT, config.textureFilter.txPath);
SaveDirectory(IDC_TEX_CACHE_PATH_EDIT, config.textureFilter.txCachePath);
SaveDirectory(IDC_TEX_DUMP_PATH_EDIT, config.textureFilter.txDumpPath);
config.textureFilter.txHiresFullAlphaChannel = CButton(GetDlgItem(IDC_CHK_ALPHA_CHANNEL)).GetCheck() == BST_CHECKED ? 1 : 0;
config.textureFilter.txHresAltCRC = CButton(GetDlgItem(IDC_CHK_ALTERNATIVE_CRC)).GetCheck() == BST_CHECKED ? 1 : 0;
config.textureFilter.txHiresTextureFileStorage = CButton(GetDlgItem(IDC_CHK_HIRES_TEX_FILESTORAGE)).GetCheck() == BST_CHECKED ? 1 : 0;
config.textureFilter.txCacheSize = m_TextureFilterCacheSpin.GetPos() * gc_uMegabyte * 50;
config.textureFilter.txSaveCache = CButton(GetDlgItem(IDC_CHK_SAVE_TEXTURE_CACHE)).GetCheck() == BST_CHECKED ? 1 : 0;
config.textureFilter.txCacheCompression = CButton(GetDlgItem(IDC_CHK_COMPRESS_CACHE)).GetCheck() == BST_CHECKED ? 1 : 0;
config.textureFilter.txForce16bpp = CButton(GetDlgItem(IDC_CHK_FORCE_16BPP)).GetCheck() == BST_CHECKED ? 1 : 0;
}
void CTextureEnhancementTab::OnSelectTexPackPath(UINT /*Code*/, int /*id*/, HWND /*ctl*/)
{
SelectDir(L"Select directory for texture pack path", IDC_TEX_PACK_PATH_EDIT);
}
void CTextureEnhancementTab::OnSelectTexCachePath(UINT /*Code*/, int /*id*/, HWND /*ctl*/)
{
SelectDir(L"Select directory for texture cache path", IDC_TEX_CACHE_PATH_EDIT);
}
void CTextureEnhancementTab::OnSelectTexDumpPath(UINT /*Code*/, int /*id*/, HWND /*ctl*/)
{
SelectDir(L"Select directory for texture dump path", IDC_TEX_DUMP_PATH_EDIT);
}
void CTextureEnhancementTab::SelectDir(wchar_t * Title, int EditCtrl)
{
wchar_t Buffer[MAX_PATH], Directory[MAX_PATH];
LPITEMIDLIST pidl;
BROWSEINFOW bi;
CWindow EditWnd = GetDlgItem(EditCtrl);
int TxtLen = EditWnd.GetWindowTextLength();
std::wstring EditText;
EditText.resize(TxtLen + 1);
EditWnd.GetWindowText((wchar_t *)EditText.data(), static_cast<int>(EditText.size()));
bi.hwndOwner = m_hWnd;
bi.pidlRoot = NULL;
bi.pszDisplayName = Buffer;
bi.lpszTitle = Title;
bi.ulFlags = BIF_RETURNFSANCESTORS | BIF_RETURNONLYFSDIRS;
bi.lpfn = (BFFCALLBACK)SelectDirCallBack;
bi.lParam = (DWORD)EditText.c_str();
if ((pidl = SHBrowseForFolderW(&bi)) != NULL && SHGetPathFromIDListW(pidl, Directory))
EditWnd.SetWindowText(Directory);
}
int CALLBACK CTextureEnhancementTab::SelectDirCallBack(HWND hwnd, uint32_t uMsg, uint32_t /*lp*/, uint32_t lpData)
{
switch (uMsg)
{
case BFFM_INITIALIZED:
// WParam is TRUE since you are passing a path.
// It would be FALSE if you were passing a pidl.
if (lpData)
SendMessage(hwnd, BFFM_SETSELECTION, TRUE, lpData);
break;
}
return 0;
}

View File

@ -1,47 +0,0 @@
#pragma once
#include "config-tab.h"
#include "wtl-tooltip.h"
#include "resource.h"
#include "../osal/osal_files.h"
class CTextureEnhancementTab :
public CConfigTab,
public CToolTipDialog<CTextureEnhancementTab>
{
public:
BEGIN_MSG_MAP(CTextureEnhancementTab)
MSG_WM_INITDIALOG(OnInitDialog)
MESSAGE_HANDLER(WM_CTLCOLORDLG, OnColorStatic)
MESSAGE_HANDLER(WM_CTLCOLORSTATIC, OnColorStatic)
COMMAND_HANDLER_EX(IDC_CHK_ENHANCED_TEX_FILE_STORAGE, BN_CLICKED, OnFileStorage)
COMMAND_HANDLER_EX(IDC_CHK_TEXTURE_PACK, BN_CLICKED, OnTexturePack)
COMMAND_ID_HANDLER_EX(IDC_TEX_PACK_PATH_BTN, OnSelectTexPackPath)
COMMAND_ID_HANDLER_EX(IDC_TEX_CACHE_PATH_BTN, OnSelectTexCachePath)
COMMAND_ID_HANDLER_EX(IDC_TEX_DUMP_PATH_BTN, OnSelectTexDumpPath)
MESSAGE_HANDLER(WM_VSCROLL, OnScroll)
CHAIN_MSG_MAP(CToolTipDialog<CTextureEnhancementTab>)
END_MSG_MAP()
CTextureEnhancementTab();
BOOL OnInitDialog(CWindow /*wndFocus*/, LPARAM /*lInitParam*/);
LRESULT OnColorStatic(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
LRESULT OnScroll(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/);
void OnFileStorage(UINT /*Code*/, int id, HWND /*ctl*/);
void OnTexturePack(UINT /*Code*/, int id, HWND /*ctl*/);
void ApplyLanguage(void);
void LoadSettings(bool blockCustomSettings);
void SaveSettings();
private:
static int CALLBACK SelectDirCallBack(HWND hwnd, uint32_t uMsg, uint32_t lp, uint32_t lpData);
void SaveDirectory(int EditCtrl, wchar_t * txPath);
void SelectDir(wchar_t * Title, int EditCtrl);
void OnSelectTexPackPath(UINT Code, int id, HWND ctl);
void OnSelectTexCachePath(UINT Code, int id, HWND ctl);
void OnSelectTexDumpPath(UINT Code, int id, HWND ctl);
CEdit m_TextureFilterCacheTxt;
CUpDownCtrl m_TextureFilterCacheSpin;
};

View File

@ -1,571 +0,0 @@
#include "config-video.h"
#include "FullscreenResolutions.h"
#include "util/util.h"
#include "Language.h"
#include "ConfigDlg.h"
#include "../Config.h"
#include "wtl-tooltip.h"
static struct {
unsigned short width, height;
LPCTSTR description;
}
WindowedModes[] = {
{ 320, 240, _T("320 x 240") },
{ 400, 300, _T("400 x 300") },
{ 480, 360, _T("480 x 360") },
{ 640, 480, _T("640 x 480") },
{ 800, 600, _T("800 x 600") },
{ 960, 720, _T("960 x 720") },
{ 1024, 768, _T("1024 x 768") },
{ 1152, 864, _T("1152 x 864") },
{ 1280, 960, _T("1280 x 960") },
{ 1280, 1024, _T("1280 x 1024") },
{ 1440, 1080, _T("1440 x 1080") },
{ 1600, 1024, _T("1600 x 1024") },
{ 1600, 1200, _T("1600 x 1200") }
};
static const unsigned int numWindowedModes = sizeof(WindowedModes) / sizeof(WindowedModes[0]);
static u32 pow2(u32 dim)
{
if (dim == 0) return 0;
return (1 << dim);
}
static u32 powof(u32 dim)
{
if (dim == 0) return 0;
u32 num = 2; u32 i = 1;
while (num < dim) {
num <<= 1;
i++;
}
return i;
}
CVideoTab::CVideoTab(CConfigDlg & Dlg, CFrameBufferTab & FrameBufferTab, const char * strIniPath) :
CConfigTab(IDD_TAB_VIDEO),
m_strIniPath(strIniPath),
m_LangList(GetLanguageList(strIniPath)),
m_Dlg(Dlg),
m_FrameBufferTab(FrameBufferTab)
{
m_AAInfoWarning = false;
}
CVideoTab::~CVideoTab() {
for (size_t i = 0; i < m_OverscanTabs.size(); i++)
delete m_OverscanTabs[i];
m_OverscanTabs.clear();
}
BOOL CVideoTab::OnInitDialog(CWindow /*wndFocus*/, LPARAM /*lInitParam*/) {
TTInit();
TTSize(400);
m_OverScanTab.Attach(GetDlgItem(IDC_TAB_OVERSCAN));
AddOverScanTab(VIDEO_NTSC);
AddOverScanTab(VIDEO_PAL);
m_AliasingSlider.Attach(GetDlgItem(IDC_ALIASING_SLIDER));
m_AliasingSlider.SetTicFreq(1);
m_AliasingSlider.SetRangeMin(0);
m_AliasingSlider.SetRangeMax(3);
m_AnisotropicSlider.Attach(GetDlgItem(IDC_ANISOTROPIC_SLIDER));
m_AnisotropicSlider.SetTicFreq(2);
m_AnisotropicSlider.SetRangeMin(0);
m_AnisotropicSlider.SetRangeMax(16);
CComboBox aspectComboBox(GetDlgItem(IDC_CMB_ASPECT_RATIO));
aspectComboBox.AddString(wGS(VIDEO_ASPECT_4_3).c_str());
aspectComboBox.AddString(wGS(VIDEO_ASPECT_16_19).c_str());
aspectComboBox.AddString(wGS(VIDEO_ASPECT_STRETCH).c_str());
aspectComboBox.AddString(wGS(VIDEO_ASPECT_ADJUST).c_str());
CComboBox ditheringModeComboBox(GetDlgItem(IDC_CMB_PATTERN));
ditheringModeComboBox.AddString(wGS(VIDEO_DITHERING_DISABLE).c_str());
ditheringModeComboBox.AddString(wGS(VIDEO_DITHERING_BAYER).c_str());
ditheringModeComboBox.AddString(wGS(VIDEO_DITHERING_MAGIC_SQUARE).c_str());
ditheringModeComboBox.AddString(wGS(VIDEO_DITHERING_BLUE_NOISE).c_str());
SIZE iconSz = { ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON) };
m_AAInfoIcon.SubclassWindow(GetDlgItem(IDC_AA_INFO_ICON));
m_AAInfoIcon.SetIcon(MAKEINTRESOURCE(IDI_ICON_INFO), iconSz.cx, iconSz.cy);
m_AAInfoIcon.SetWindowPos(HWND_TOP, 0, 0, iconSz.cx, iconSz.cy, SWP_NOMOVE | SWP_NOZORDER);
m_AAInfoIcon.SetBackroundBrush((HBRUSH)GetStockObject(WHITE_BRUSH));
CComboBox translationsComboBox(GetDlgItem(IDC_CMB_LANGUAGE));
translationsComboBox.SetItemData(translationsComboBox.AddString((LPCTSTR)_T("English")), (DWORD_PTR)"");
for (LanguageList::const_iterator itr = m_LangList.begin(); itr != m_LangList.end(); itr++) {
int indx = translationsComboBox.AddString(ToUTF16(itr->LanguageName.c_str()).c_str());
translationsComboBox.SetItemData(indx, (DWORD_PTR)itr->Filename.c_str());
}
return true;
}
void CVideoTab::ApplyLanguage(void) {
SetDlgItemTextW(IDC_VIDEO_GROUP, wGS(VIDEO_GROUP).c_str());
SetDlgItemTextW(IDC_TXT_FULL_SCREEN_RES, wGS(VIDEO_FULL_SCREEN_RES).c_str());
SetDlgItemTextW(IDC_TXT_REFRESH_RATE, wGS(VIDEO_REFRESH_RATE).c_str());
SetDlgItemTextW(IDC_TXT_WINDOWED_RESOLUTION, wGS(VIDEO_WINDOWED_RESOLUTION).c_str());
SetDlgItemTextW(IDC_TXT_ASPECT_RATIO, wGS(VIDEO_ASPECT_RATIO).c_str());
SetDlgItemTextW(IDC_CHK_VERTICAL_SYNC, wGS(VIDEO_VSYNC).c_str());
SetDlgItemTextW(IDC_CHK_THREADED_VIDEO, wGS(VIDEO_THREADED_VIDEO).c_str());
SetDlgItemTextW(IDC_CHK_OVERSCAN, wGS(VIDEO_OVERSCAN).c_str());
SetDlgItemTextW(IDC_AA_GROUP, wGS(VIDEO_ANTI_ALIASING).c_str());
SetDlgItemTextW(IDC_NOAA_RADIO, wGS(VIDEO_NO_ANTI_ALIASING).c_str());
SetDlgItemTextW(IDC_FXAA_RADIO, wGS(VIDEO_FAST_ANTI_ALIASING).c_str());
SetDlgItemTextW(IDC_MSAA_RADIO, wGS(VIDEO_MULTISAMPLE_ANTI_ALIASING).c_str());
SetDlgItemTextW(IDC_AA_OFF, wGS(VIDEO_AA_OFF).c_str());
SetDlgItemTextW(IDC_AA_HIGH, wGS(VIDEO_AA_HIGH).c_str());
SetDlgItemTextW(IDC_AA_INFO, wGS(VIDEO_AA_INFO).c_str());
SetDlgItemTextW(IDC_FILTERING_GROUP, wGS(VIDEO_FILTERING_GROUP).c_str());
SetDlgItemTextW(IDC_ANISOTROPIC, wGS(VIDEO_ANISOTROPIC).c_str());
SetDlgItemTextW(IDC_ANISOTROPIC_OFF, wGS(VIDEO_ANISOTROPIC_OFF).c_str());
SetDlgItemTextW(IDC_ANISOTROPIC_HIGH, wGS(VIDEO_ANISOTROPIC_HIGH).c_str());
SetDlgItemTextW(IDC_BILINEAR, wGS(VIDEO_BILINEAR).c_str());
SetDlgItemTextW(IDC_BILINEAR_STANDARD, wGS(VIDEO_BILINEAR_STANDARD).c_str());
SetDlgItemTextW(IDC_BILINEAR_3POINT, wGS(VIDEO_BILINEAR_3POINT).c_str());
SetDlgItemTextW(IDC_DITHERING_GROUP, wGS(VIDEO_DITHERING_GROUP).c_str());
SetDlgItemTextW(IDC_PATTERN, wGS(VIDEO_PATTERN).c_str());
SetDlgItemTextW(IDC_CHK_APPLY_TO_OUTPUT, wGS(VIDEO_DITHERING_APPLY_TO_OUTPUT).c_str());
SetDlgItemTextW(IDC_CHK_5BIT_QUANTIZATION, wGS(VIDEO_DITHERING_5BIT_QUANTIZATION).c_str());
SetDlgItemTextW(IDC_CHK_HIRES_NOISE, wGS(VIDEO_DITHERING_HIRES_NOISE).c_str());
SetDlgItemTextW(IDC_LANGUAGE, wGS(VIDEO_LANGUAGE).c_str());
std::wstring tooltip = wGS(VIDEO_FULL_SCREEN_RES_TOOLTIP);
TTSetTxt(GetDlgItem(IDC_TXT_FULL_SCREEN_RES), tooltip.c_str());
TTSetTxt(GetDlgItem(IDC_CMB_FULL_SCREEN_RES), tooltip.c_str());
tooltip = wGS(VIDEO_REFRESH_RATE_TOOLTIP);
TTSetTxt(GetDlgItem(IDC_TXT_REFRESH_RATE), tooltip.c_str());
TTSetTxt(GetDlgItem(IDC_CMB_REFRESH_RATE), tooltip.c_str());
tooltip = wGS(VIDEO_WINDOWED_RESOLUTION_TOOLTIP);
TTSetTxt(GetDlgItem(IDC_TXT_WINDOWED_RESOLUTION), tooltip.c_str());
TTSetTxt(GetDlgItem(IDC_CMB_WINDOWED_RESOLUTION), tooltip.c_str());
tooltip = wGS(VIDEO_ASPECT_RATIO_TOOLTIP);
TTSetTxt(GetDlgItem(IDC_TXT_ASPECT_RATIO), tooltip.c_str());
TTSetTxt(GetDlgItem(IDC_CMB_ASPECT_RATIO), tooltip.c_str());
tooltip = wGS(VIDEO_VSYNC_TOOLTIP);
TTSetTxt(GetDlgItem(IDC_CHK_VERTICAL_SYNC), tooltip.c_str());
tooltip = wGS(VIDEO_THREADED_VIDEO_TOOLTIP);
TTSetTxt(GetDlgItem(IDC_CHK_THREADED_VIDEO), tooltip.c_str());
tooltip = wGS(VIDEO_OVERSCAN_TOOLTIP);
TTSetTxt(GetDlgItem(IDC_CHK_OVERSCAN), tooltip.c_str());
tooltip = wGS(VIDEO_AA_TOOLTIP);
TTSetTxt(GetDlgItem(IDC_AA_GROUP), tooltip.c_str());
TTSetTxt(GetDlgItem(IDC_NOAA_RADIO), tooltip.c_str());
TTSetTxt(GetDlgItem(IDC_FXAA_RADIO), tooltip.c_str());
TTSetTxt(GetDlgItem(IDC_MSAA_RADIO), tooltip.c_str());
TTSetTxt(GetDlgItem(IDC_ALIASING_SLIDER), tooltip.c_str());
TTSetTxt(GetDlgItem(IDC_AA_OFF), tooltip.c_str());
TTSetTxt(GetDlgItem(IDC_AA_HIGH), tooltip.c_str());
tooltip = wGS(VIDEO_BILINEAR_TOOLTIP);
TTSetTxt(GetDlgItem(IDC_BILINEAR), tooltip.c_str());
TTSetTxt(GetDlgItem(IDC_BILINEAR_STANDARD), tooltip.c_str());
TTSetTxt(GetDlgItem(IDC_BILINEAR_3POINT), tooltip.c_str());
tooltip = wGS(VIDEO_DITHERING_APPLY_TO_OUTPUT_TOOLTIP);
TTSetTxt(GetDlgItem(IDC_CHK_APPLY_TO_OUTPUT), tooltip.c_str());
tooltip = wGS(VIDEO_DITHERING_5BIT_QUANTIZATION_TOOLTIP);
TTSetTxt(GetDlgItem(IDC_CHK_5BIT_QUANTIZATION), tooltip.c_str());
tooltip = wGS(VIDEO_DITHERING_HIRES_NOISE_TOOLTIP);
TTSetTxt(GetDlgItem(IDC_CHK_HIRES_NOISE), tooltip.c_str());
tooltip = wGS(VIDEO_DITHERING_MODE_TOOLTIP);
TTSetTxt(GetDlgItem(IDC_CMB_PATTERN), tooltip.c_str());
CComboBox aspectComboBox(GetDlgItem(IDC_CMB_ASPECT_RATIO));
int selectedIndx = aspectComboBox.GetCurSel();
aspectComboBox.ResetContent();
aspectComboBox.AddString(wGS(VIDEO_ASPECT_4_3).c_str());
aspectComboBox.AddString(wGS(VIDEO_ASPECT_16_19).c_str());
aspectComboBox.AddString(wGS(VIDEO_ASPECT_STRETCH).c_str());
aspectComboBox.AddString(wGS(VIDEO_ASPECT_ADJUST).c_str());
if (selectedIndx >= 0)
aspectComboBox.SetCurSel(selectedIndx);
CComboBox ditheringModeComboBox(GetDlgItem(IDC_CMB_PATTERN));
selectedIndx = ditheringModeComboBox.GetCurSel();
ditheringModeComboBox.ResetContent();
ditheringModeComboBox.AddString(wGS(VIDEO_DITHERING_DISABLE).c_str());
ditheringModeComboBox.AddString(wGS(VIDEO_DITHERING_BAYER).c_str());
ditheringModeComboBox.AddString(wGS(VIDEO_DITHERING_MAGIC_SQUARE).c_str());
ditheringModeComboBox.AddString(wGS(VIDEO_DITHERING_BLUE_NOISE).c_str());
if (selectedIndx >= 0)
ditheringModeComboBox.SetCurSel(selectedIndx);
for (int i = 0, n = m_OverScanTab.GetItemCount(); i < n; i++) {
TCITEM tci = { 0 };
tci.mask = TCIF_PARAM;
m_OverScanTab.GetItem(i, &tci);
if (tci.lParam != 0) {
tci.mask = TCIF_TEXT;
std::wstring caption = wGS((languageStringID)tci.lParam);
tci.pszText = (LPWSTR)caption.c_str();
m_OverScanTab.SetItem(i, &tci);
}
}
}
LRESULT CVideoTab::OnScroll(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/) {
LONG SliderId = CWindow((HWND)lParam).GetWindowLong(GWL_ID);
if (SliderId == IDC_ALIASING_SLIDER) {
int32_t multisampling = m_AliasingSlider.GetPos();
std::wstring AliasingText = FormatStrW(L"%dx", pow2(multisampling));
CWindow(GetDlgItem(IDC_ALIASING_LABEL)).SetWindowTextW(AliasingText.c_str());
CButton(GetDlgItem(multisampling != 0 ? IDC_MSAA_RADIO : IDC_NOAA_RADIO)).SetCheck(BST_CHECKED);
CButton(GetDlgItem(multisampling != 0 ? IDC_NOAA_RADIO : IDC_MSAA_RADIO)).SetCheck(BST_UNCHECKED);
CButton(GetDlgItem(IDC_FXAA_RADIO)).SetCheck(BST_UNCHECKED);
} else if (SliderId == IDC_ANISOTROPIC_SLIDER) {
CWindow(GetDlgItem(IDC_ANISOTROPIC_LABEL)).SetWindowTextW(FormatStrW(L"%dx", m_AnisotropicSlider.GetPos()).c_str());
}
return 0;
}
void CVideoTab::OnOverscan(UINT /*Code*/, int /*id*/, HWND /*ctl*/) {
CButton OverScan(GetDlgItem(IDC_CHK_OVERSCAN));
if (OverScan.GetCheck() == BST_CHECKED) {
GetDlgItem(IDC_TAB_OVERSCAN).ShowWindow(SW_SHOW);
ShowOverScanTab(m_OverScanTab.GetCurSel());
} else {
GetDlgItem(IDC_TAB_OVERSCAN).ShowWindow(SW_HIDE);
m_OverscanTabs[m_OverScanTab.GetCurSel()]->ShowWindow(SW_HIDE);
}
}
LRESULT CVideoTab::OnColorStatic(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) {
return (LRESULT)GetStockObject(WHITE_BRUSH);
}
LRESULT CVideoTab::OnOverscanTabChange(NMHDR* /*pNMHDR*/) {
ShowOverScanTab(m_OverScanTab.GetCurSel());
return FALSE;
}
void CVideoTab::OnFullScreenChanged(UINT /*Code*/, int /*id*/, HWND /*ctl*/) {
CComboBox fullScreenResolutionComboBox(GetDlgItem(IDC_CMB_FULL_SCREEN_RES));
int32_t index = fullScreenResolutionComboBox.GetCurSel();
StringList fullscreenRatesList;
int fullscreenRate;
fillFullscreenRefreshRateList(index, fullscreenRatesList, fullscreenRate);
CComboBox RefreshRateComboBox(GetDlgItem(IDC_CMB_REFRESH_RATE));
RefreshRateComboBox.ResetContent();
for (size_t i = 0, n = fullscreenRatesList.size(); i < n; i++) {
std::wstring fullscreenRateStr(fullscreenRatesList[i].begin(), fullscreenRatesList[i].end());
int index = RefreshRateComboBox.AddString(fullscreenRateStr.c_str());
if (fullscreenRate == i)
RefreshRateComboBox.SetCurSel(index);
}
}
LRESULT CVideoTab::OnLanguageChanged(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hwnd*/, BOOL& /*bHandled*/) {
CComboBox translationsComboBox(GetDlgItem(IDC_CMB_LANGUAGE));
std::string currentLang = (const char *)translationsComboBox.GetItemDataPtr(translationsComboBox.GetCurSel());
m_Dlg.SetLanguage(currentLang);
return 0;
}
void CVideoTab::HideMSAADepthWarning(bool hide)
{
int nID[] = {
IDC_AA_INFO,
IDC_AA_INFO_ICON,
IDC_FILTERING_GROUP,
IDC_ANISOTROPIC,
IDC_ANISOTROPIC_OFF,
IDC_ANISOTROPIC_HIGH,
IDC_ANISOTROPIC_SLIDER,
IDC_ANISOTROPIC_LABEL,
IDC_BILINEAR,
IDC_BILINEAR_STANDARD,
IDC_BILINEAR_3POINT,
IDC_DITHERING_GROUP,
IDC_PATTERN,
IDC_CMB_PATTERN,
IDC_CHK_APPLY_TO_OUTPUT,
IDC_CHK_5BIT_QUANTIZATION,
IDC_CHK_HIRES_NOISE
};
RECT Rect; RECT groupRect;
GetDlgItem(nID[0]).GetWindowRect(&Rect);
::MapWindowPoints(NULL, m_hWnd, (LPPOINT)&Rect, 2);
int32_t Move = Rect.bottom - Rect.top + 2;
GetDlgItem(nID[0]).ShowWindow(hide ? SW_HIDE : SW_SHOWNORMAL);
GetDlgItem(nID[1]).ShowWindow(hide ? SW_HIDE : SW_SHOWNORMAL);
CWindow AAgroup = GetDlgItem(IDC_AA_GROUP);
AAgroup.GetWindowRect(&groupRect);
::MapWindowPoints(NULL, m_hWnd, (LPPOINT)&groupRect, 2);
SIZE AAgroupSz = { groupRect.right - groupRect.left, hide ? groupRect.bottom - groupRect.top - Move - 1 : groupRect.bottom - groupRect.top + Move + 1 };
AAgroup.SetWindowPos(HWND_TOP, 0, 0, AAgroupSz.cx, AAgroupSz.cy, SWP_NOMOVE | SWP_NOZORDER);
for (size_t i = 2, n = sizeof(nID) / sizeof(nID[0]); i < n; i++) {
CWindow window = GetDlgItem(nID[i]);
window.GetWindowRect(&Rect);
::MapWindowPoints(NULL, m_hWnd, (LPPOINT)&Rect, 2);
Rect.top -= hide ? Move : -Move;
Rect.bottom -= hide ? Move : -Move;
window.MoveWindow(&Rect);
}
m_AAInfoWarning = hide;
}
void CVideoTab::DisallowMSAA(bool disallow)
{
GetDlgItem(IDC_MSAA_RADIO).EnableWindow(!disallow);
GetDlgItem(IDC_ALIASING_SLIDER).EnableWindow(!disallow);
GetDlgItem(IDC_ALIASING_LABEL).EnableWindow(!disallow);
GetDlgItem(IDC_AA_HIGH).EnableWindow(!disallow);
GetDlgItem(IDC_AA_OFF).EnableWindow(!disallow);
}
void CVideoTab::AddOverScanTab(languageStringID caption) {
m_OverScanTab.AddItem(TCIF_TEXT | TCIF_PARAM, wGS(caption).c_str(), 0, caption);
COverScanTab * tab = new COverScanTab;
tab->Create(m_hWnd, 0);
tab->SetWindowPos(m_hWnd, 0, 0, 0, 0, SWP_HIDEWINDOW);
m_OverscanTabs.push_back(tab);
if (m_OverscanTabs.size() == 1)
ShowOverScanTab(0);
}
void CVideoTab::ShowOverScanTab(int nTab) {
for (size_t i = 0; i < m_OverscanTabs.size(); i++)
m_OverscanTabs[i]->ShowWindow(SW_HIDE);
CRect TabRect;
m_OverScanTab.GetWindowRect(&TabRect);
ScreenToClient(&TabRect);
m_OverScanTab.AdjustRect(FALSE, &TabRect);
m_OverscanTabs[nTab]->SetWindowPos(HWND_TOP, TabRect.left, TabRect.top, TabRect.Width(), TabRect.Height(), SWP_SHOWWINDOW);
CRect WinRect, ClientRect;
m_OverscanTabs[nTab]->GetWindowRect(WinRect);
m_OverscanTabs[nTab]->GetClientRect(ClientRect);
m_OverScanTab.RedrawWindow();
}
void CVideoTab::LoadSettings(bool /*blockCustomSettings*/) {
CComboBox WindowedResolutionComboBox(GetDlgItem(IDC_CMB_WINDOWED_RESOLUTION));
if (WindowedResolutionComboBox.GetCount() == 0) {
for (unsigned int i = 0; i < numWindowedModes; ++i) {
int index = WindowedResolutionComboBox.AddString(WindowedModes[i].description);
WindowedResolutionComboBox.SetItemData(index, i);
if (WindowedModes[i].width == config.video.windowedWidth && WindowedModes[i].height == config.video.windowedHeight)
WindowedResolutionComboBox.SetCurSel(index);
}
if (WindowedResolutionComboBox.GetCount() > 0 && WindowedResolutionComboBox.GetCurSel() < 0) {
WindowedResolutionComboBox.AddString(FormatStrW(L"%d x %d", config.video.windowedWidth, config.video.windowedHeight).c_str());
WindowedResolutionComboBox.SetCurSel(numWindowedModes);
}
}
CButton overscanCheckBox(GetDlgItem(IDC_CHK_OVERSCAN));
overscanCheckBox.SetCheck(config.frameBufferEmulation.enableOverscan != 0 ? BST_CHECKED : BST_UNCHECKED);
OnOverscan(0, 0, NULL);
m_OverscanTabs[0]->SetValue(
config.frameBufferEmulation.overscanNTSC.left,
config.frameBufferEmulation.overscanNTSC.right,
config.frameBufferEmulation.overscanNTSC.top,
config.frameBufferEmulation.overscanNTSC.bottom
);
m_OverscanTabs[1]->SetValue(
config.frameBufferEmulation.overscanPAL.left,
config.frameBufferEmulation.overscanPAL.right,
config.frameBufferEmulation.overscanPAL.top,
config.frameBufferEmulation.overscanPAL.bottom
);
StringList fullscreenModesList, fullscreenRatesList;
int fullscreenMode, fullscreenRate;
fillFullscreenResolutionsList(fullscreenModesList, fullscreenMode, fullscreenRatesList, fullscreenRate);
CComboBox fullScreenResolutionComboBox(GetDlgItem(IDC_CMB_FULL_SCREEN_RES));
fullScreenResolutionComboBox.ResetContent();
for (size_t i = 0, n = fullscreenModesList.size(); i < n; i++) {
std::wstring fullscreenModeStr(fullscreenModesList[i].begin(), fullscreenModesList[i].end());
int index = fullScreenResolutionComboBox.AddString(fullscreenModeStr.c_str());
if (fullscreenMode == i)
fullScreenResolutionComboBox.SetCurSel(index);
}
CComboBox RefreshRateComboBox(GetDlgItem(IDC_CMB_REFRESH_RATE));
RefreshRateComboBox.ResetContent();
for (size_t i = 0, n = fullscreenRatesList.size(); i < n; i++) {
std::wstring fullscreenRateStr(fullscreenRatesList[i].begin(), fullscreenRatesList[i].end());
int index = RefreshRateComboBox.AddString(fullscreenRateStr.c_str());
if (fullscreenRate == i)
RefreshRateComboBox.SetCurSel(index);
}
u32 maxMSAALevel = m_Dlg.getMSAALevel();
if (maxMSAALevel == 0 && config.video.maxMultiSampling == 0) {
// default value
maxMSAALevel = 8;
} else if (maxMSAALevel == 0 && config.video.maxMultiSampling != 0) {
// use cached value
maxMSAALevel = config.video.maxMultiSampling;
} else {
// assign cached value
config.video.maxMultiSampling = maxMSAALevel;
}
const unsigned int multisampling = config.video.fxaa == 0 && config.video.multisampling > 0
? min(config.video.multisampling, maxMSAALevel)
: maxMSAALevel;
m_AliasingSlider.SetRangeMax(powof(maxMSAALevel));
m_AliasingSlider.SetPos(powof(multisampling));
std::wstring AliasingText = FormatStrW(L"%dx", multisampling);
CWindow(GetDlgItem(IDC_ALIASING_LABEL)).SetWindowTextW(AliasingText.c_str());
if (config.frameBufferEmulation.N64DepthCompare == 0) {
if (!m_AAInfoWarning) {
HideMSAADepthWarning(true);
RedrawWindow();
}
DisallowMSAA(false);
} else {
if (m_AAInfoWarning) {
HideMSAADepthWarning(false);
RedrawWindow();
}
DisallowMSAA(true);
}
CButton(GetDlgItem(IDC_NOAA_RADIO)).SetCheck(config.video.multisampling == 0 && config.video.fxaa == 0 ? BST_CHECKED : BST_UNCHECKED);
CButton(GetDlgItem(IDC_FXAA_RADIO)).SetCheck(config.video.fxaa != 0 && config.video.multisampling == 0 ? BST_CHECKED : BST_UNCHECKED);
CButton(GetDlgItem(IDC_MSAA_RADIO)).SetCheck(config.video.fxaa == 0 && config.video.multisampling != 0 ? BST_CHECKED : BST_UNCHECKED);
u32 maxAnisotropy = m_Dlg.getMaxAnisotropy();
if (maxAnisotropy == 0 && config.texture.maxAnisotropy == 0) {
// default value
maxAnisotropy = 16;
} else if (maxAnisotropy == 0 && config.texture.maxAnisotropy != 0) {
// use cached value
maxAnisotropy = config.texture.maxAnisotropy;
} else {
// assign cached value
config.texture.maxAnisotropy = maxAnisotropy;
}
const u32 anisotropy = min(config.texture.anisotropy, maxAnisotropy);
m_AnisotropicSlider.SetRangeMax(maxAnisotropy);
m_AnisotropicSlider.SetPos(anisotropy);
CWindow(GetDlgItem(IDC_ANISOTROPIC_LABEL)).SetWindowTextW(FormatStrW(L"%dx", m_AnisotropicSlider.GetPos()).c_str());
CButton(GetDlgItem(IDC_CHK_VERTICAL_SYNC)).SetCheck(config.video.verticalSync != 0 ? BST_CHECKED : BST_UNCHECKED);
CButton(GetDlgItem(IDC_CHK_THREADED_VIDEO)).SetCheck(config.video.threadedVideo != 0 ? BST_CHECKED : BST_UNCHECKED);
CButton(GetDlgItem(IDC_BILINEAR_3POINT)).SetCheck(config.texture.bilinearMode == BILINEAR_3POINT ? BST_CHECKED : BST_UNCHECKED);
CButton(GetDlgItem(IDC_BILINEAR_STANDARD)).SetCheck(config.texture.bilinearMode == BILINEAR_STANDARD ? BST_CHECKED : BST_UNCHECKED);
CComboBox aspectComboBox(GetDlgItem(IDC_CMB_ASPECT_RATIO));
switch (config.frameBufferEmulation.aspect) {
case Config::aStretch: aspectComboBox.SetCurSel(2); break;
case Config::a43: aspectComboBox.SetCurSel(0); break;
case Config::a169: aspectComboBox.SetCurSel(1); break;
case Config::aAdjust: aspectComboBox.SetCurSel(3); break;
}
CComboBox(GetDlgItem(IDC_CMB_PATTERN)).SetCurSel(config.generalEmulation.rdramImageDitheringMode);
CButton(GetDlgItem(IDC_CHK_APPLY_TO_OUTPUT)).SetCheck(config.generalEmulation.enableDitheringPattern != 0 ? BST_CHECKED : BST_UNCHECKED);
CButton(GetDlgItem(IDC_CHK_5BIT_QUANTIZATION)).SetCheck(config.generalEmulation.enableDitheringQuantization != 0 ? BST_CHECKED : BST_UNCHECKED);
CButton(GetDlgItem(IDC_CHK_HIRES_NOISE)).SetCheck(config.generalEmulation.enableHiresNoiseDithering != 0 ? BST_CHECKED : BST_UNCHECKED);
CComboBox translationsComboBox(GetDlgItem(IDC_CMB_LANGUAGE));
translationsComboBox.SetCurSel(-1);
for (int i = 0, n = translationsComboBox.GetCount(); i < n; i++) {
const char * translations = (const char *)translationsComboBox.GetItemDataPtr(i);
if (config.translationFile == translations) {
translationsComboBox.SetCurSel(i);
break;
}
}
if (translationsComboBox.GetCurSel() < 0)
translationsComboBox.SetCurSel(translationsComboBox.FindString(-1, (LPCTSTR)_T("English")));
}
void CVideoTab::SaveSettings()
{
getFullscreenResolutions(CComboBox(GetDlgItem(IDC_CMB_FULL_SCREEN_RES)).GetCurSel(), config.video.fullscreenWidth, config.video.fullscreenHeight);
getFullscreenRefreshRate(CComboBox(GetDlgItem(IDC_CMB_REFRESH_RATE)).GetCurSel(), config.video.fullscreenRefresh);
CComboBox WindowResCB(GetDlgItem(IDC_CMB_WINDOWED_RESOLUTION));
CString WindowResStr;
WindowResCB.GetWindowText(WindowResStr);
std::string resolution(CW2A(WindowResStr.GetString()));
std::regex parseRes("(\\d+) ?x ?(\\d+)");
std::smatch tokens;
if (std::regex_search(resolution, tokens, parseRes) && tokens.size() > 1) {
// matches w x h where w is 300-7999 and h is 200-3999
if (range<300, 8000>::contains(std::stoi(tokens[1])) && range<200, 4000>::contains(std::stoi(tokens[2]))) {
config.video.windowedWidth = std::stoi(tokens[1]);
config.video.windowedHeight = std::stoi(tokens[2]);
}
}
int AspectIndx = CComboBox(GetDlgItem(IDC_CMB_ASPECT_RATIO)).GetCurSel();
if (AspectIndx == 2) { config.frameBufferEmulation.aspect = Config::aStretch; }
else if (AspectIndx == 0) { config.frameBufferEmulation.aspect = Config::a43; }
else if (AspectIndx == 1) { config.frameBufferEmulation.aspect = Config::a169; }
else if (AspectIndx == 3) { config.frameBufferEmulation.aspect = Config::aAdjust; }
config.video.verticalSync = CButton(GetDlgItem(IDC_CHK_VERTICAL_SYNC)).GetCheck() == BST_CHECKED;
config.video.threadedVideo = CButton(GetDlgItem(IDC_CHK_THREADED_VIDEO)).GetCheck() == BST_CHECKED;
config.frameBufferEmulation.enableOverscan = CButton(GetDlgItem(IDC_CHK_OVERSCAN)).GetCheck() == BST_CHECKED;
m_OverscanTabs[0]->GetValue(
config.frameBufferEmulation.overscanNTSC.left,
config.frameBufferEmulation.overscanNTSC.right,
config.frameBufferEmulation.overscanNTSC.top,
config.frameBufferEmulation.overscanNTSC.bottom
);
m_OverscanTabs[1]->GetValue(
config.frameBufferEmulation.overscanPAL.left,
config.frameBufferEmulation.overscanPAL.right,
config.frameBufferEmulation.overscanPAL.top,
config.frameBufferEmulation.overscanPAL.bottom
);
config.video.fxaa = CButton(GetDlgItem(IDC_FXAA_RADIO)).GetCheck() == BST_CHECKED ? 1 : 0;
if (CButton(GetDlgItem(IDC_FXAA_RADIO)).GetCheck() == BST_CHECKED
|| CButton(GetDlgItem(IDC_NOAA_RADIO)).GetCheck() == BST_CHECKED
|| CComboBox(m_FrameBufferTab.GetDlgItem(IDC_CMB_N64_DEPTH_COMPARE)).GetCurSel() != 0) {
config.video.multisampling = 0;
} else {
config.video.multisampling = pow2(m_AliasingSlider.GetPos());
}
if (CButton(GetDlgItem(IDC_MSAA_RADIO)).GetCheck() == BST_CHECKED
&& CComboBox(m_FrameBufferTab.GetDlgItem(IDC_CMB_N64_DEPTH_COMPARE)).GetCurSel() != 0) {
config.video.fxaa = 1;
}
config.texture.anisotropy = m_AnisotropicSlider.GetPos();
if (CButton(GetDlgItem(IDC_BILINEAR_3POINT)).GetCheck() == BST_CHECKED)
config.texture.bilinearMode = BILINEAR_3POINT;
if (CButton(GetDlgItem(IDC_BILINEAR_STANDARD)).GetCheck() == BST_CHECKED)
config.texture.bilinearMode = BILINEAR_STANDARD;
config.generalEmulation.rdramImageDitheringMode = CComboBox(GetDlgItem(IDC_CMB_PATTERN)).GetCurSel();
config.generalEmulation.enableDitheringPattern = CButton(GetDlgItem(IDC_CHK_APPLY_TO_OUTPUT)).GetCheck() == BST_CHECKED ? 1 : 0;
config.generalEmulation.enableDitheringQuantization = CButton(GetDlgItem(IDC_CHK_5BIT_QUANTIZATION)).GetCheck() == BST_CHECKED ? 1 : 0;
config.generalEmulation.enableHiresNoiseDithering = CButton(GetDlgItem(IDC_CHK_HIRES_NOISE)).GetCheck() == BST_CHECKED ? 1 : 0;
CComboBox translationsComboBox(GetDlgItem(IDC_CMB_LANGUAGE));
config.translationFile = (const char *)translationsComboBox.GetItemDataPtr(translationsComboBox.GetCurSel());
}

View File

@ -1,66 +0,0 @@
#define _WTL_NO_CSTRING
#pragma once
#include "config-tab.h"
#include "config-overscan.h"
#include "config-framebuffer.h"
#include "wtl-BitmapPicture.h"
#include "wtl-tooltip.h"
#include "resource.h"
#include "Language.h"
#include <atlstr.h>
#include <vector>
#include <regex>
class CConfigDlg;
class CFrameBufferTab;
class CVideoTab :
public CConfigTab,
public CToolTipDialog<CVideoTab>
{
public:
BEGIN_MSG_MAP(CVideoTab)
MSG_WM_INITDIALOG(OnInitDialog)
MESSAGE_HANDLER(WM_CTLCOLORDLG, OnColorStatic)
MESSAGE_HANDLER(WM_CTLCOLORSTATIC, OnColorStatic)
MESSAGE_HANDLER(WM_PRINTCLIENT, OnColorStatic)
NOTIFY_HANDLER_EX(IDC_TAB_OVERSCAN, TCN_SELCHANGE, OnOverscanTabChange)
COMMAND_HANDLER_EX(IDC_CMB_FULL_SCREEN_RES, CBN_SELCHANGE, OnFullScreenChanged)
COMMAND_HANDLER_EX(IDC_CHK_OVERSCAN, BN_CLICKED, OnOverscan)
COMMAND_HANDLER(IDC_CMB_LANGUAGE, CBN_SELCHANGE, OnLanguageChanged)
MESSAGE_HANDLER(WM_HSCROLL, OnScroll)
MESSAGE_HANDLER(WM_VSCROLL, OnScroll)
CHAIN_MSG_MAP(CToolTipDialog<CVideoTab>)
REFLECT_NOTIFICATIONS()
END_MSG_MAP()
CVideoTab(CConfigDlg & Dlg, CFrameBufferTab & FrameBufferTab, const char * strIniPath);
~CVideoTab();
bool m_AAInfoWarning;
BOOL OnInitDialog(CWindow /*wndFocus*/, LPARAM /*lInitParam*/);
LRESULT OnScroll(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/);
void OnOverscan(UINT /*Code*/, int id, HWND /*ctl*/);
LRESULT OnColorStatic(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
LRESULT OnOverscanTabChange(NMHDR* /*pNMHDR*/);
void OnFullScreenChanged(UINT /*Code*/, int id, HWND /*ctl*/);
LRESULT OnLanguageChanged(WORD wNotifyCode, WORD wID, HWND hwnd, BOOL& bHandled);
void HideMSAADepthWarning(bool hide);
void DisallowMSAA(bool disallow);
void AddOverScanTab(languageStringID caption);
void ShowOverScanTab(int nTab);
void ApplyLanguage(void);
void LoadSettings(bool blockCustomSettings);
void SaveSettings();
CTabCtrl m_OverScanTab;
std::vector<COverScanTab *> m_OverscanTabs;
CTrackBarCtrl m_AliasingSlider;
CTrackBarCtrl m_AnisotropicSlider;
CBitmapPicture m_AAInfoIcon;
std::string m_strIniPath;
LanguageList m_LangList;
CConfigDlg & m_Dlg;
CFrameBufferTab & m_FrameBufferTab;
};

View File

@ -1,180 +0,0 @@
#include <windows.h>
#include <stdio.h>
#include "FullscreenResolutions.h"
#include "../Config.h"
#if defined(_MSC_VER) && _MSC_VER < 1900
#define snprintf c99_snprintf
#define vsnprintf c99_vsnprintf
__inline int c99_vsnprintf(char *outBuf, size_t size, const char *format, va_list ap)
{
int count = -1;
if (size != 0)
count = _vsnprintf_s(outBuf, size, _TRUNCATE, format, ap);
if (count == -1)
count = _vscprintf(format, ap);
return count;
}
__inline int c99_snprintf(char *outBuf, size_t size, const char *format, ...)
{
int count;
va_list ap;
va_start(ap, format);
count = c99_vsnprintf(outBuf, size, format, ap);
va_end(ap);
return count;
}
#endif
static
struct
{
struct
{
DWORD width, height, refreshRate;
} selected;
struct
{
DWORD width, height;
} resolution[32];
DWORD refreshRate[32];
DWORD numResolutions;
DWORD numRefreshRates;
} fullscreen;
static
void _fillFullscreenRefreshRateList(StringList & _listRefreshRates, int & _rateIdx)
{
memset(&fullscreen.refreshRate, 0, sizeof(fullscreen.refreshRate));
fullscreen.numRefreshRates = 0;
_rateIdx = 0;
int i = 0;
DEVMODE deviceMode;
char text[128];
while (EnumDisplaySettings(NULL, i++, &deviceMode) != 0)
{
if (deviceMode.dmBitsPerPel != 32)
continue;
DWORD j = 0;
for (; j < fullscreen.numRefreshRates; ++j) {
if ((deviceMode.dmDisplayFrequency == fullscreen.refreshRate[j]))
break;
}
if ((deviceMode.dmDisplayFrequency != fullscreen.refreshRate[j]) &&
(deviceMode.dmPelsWidth == fullscreen.selected.width) &&
(deviceMode.dmPelsHeight == fullscreen.selected.height)) {
fullscreen.refreshRate[j] = deviceMode.dmDisplayFrequency;
//: Abbreviation for Hertz; include a leading space if appropriate
snprintf(text, sizeof(text), "%d Hz", deviceMode.dmDisplayFrequency);
_listRefreshRates.push_back(text);
if (fullscreen.selected.refreshRate == deviceMode.dmDisplayFrequency)
_rateIdx = fullscreen.numRefreshRates;
++fullscreen.numRefreshRates;
}
}
}
void fillFullscreenResolutionsList(StringList & _listResolutions, int & _resolutionIdx, StringList & _listRefreshRates, int & _rateIdx)
{
fullscreen.selected.width = config.video.fullscreenWidth;
fullscreen.selected.height = config.video.fullscreenHeight;
fullscreen.selected.refreshRate = config.video.fullscreenRefresh;
memset(&fullscreen.resolution, 0, sizeof(fullscreen.resolution));
memset(&fullscreen.refreshRate, 0, sizeof(fullscreen.refreshRate));
fullscreen.numResolutions = 0;
fullscreen.numRefreshRates = 0;
_resolutionIdx = 0;
static
struct
{
unsigned short x, y;
const char *description;
} ratios[] = {
{ 3, 2, "3:2" },
{ 4, 3, "4:3" },
{ 5, 4, "5:4" },
{ 16, 9, "16:9" },
{ 8, 5, "16:10" },
{ 21, 9, "21:9" }
};
const int numRatios = sizeof(ratios);
int i = 0;
char text[128];
DEVMODE deviceMode;
while (EnumDisplaySettings(NULL, i++, &deviceMode) != 0)
{
if (deviceMode.dmBitsPerPel != 32)
continue;
DWORD j = 0;
for (; j < fullscreen.numResolutions; ++j) {
if ((deviceMode.dmPelsWidth == fullscreen.resolution[j].width) &&
(deviceMode.dmPelsHeight == fullscreen.resolution[j].height)) {
break;
}
}
if ((deviceMode.dmPelsWidth != fullscreen.resolution[j].width) ||
(deviceMode.dmPelsHeight != fullscreen.resolution[j].height)) {
fullscreen.resolution[fullscreen.numResolutions].width = deviceMode.dmPelsWidth;
fullscreen.resolution[fullscreen.numResolutions].height = deviceMode.dmPelsHeight;
snprintf(text, 128, "%i x %i", deviceMode.dmPelsWidth, deviceMode.dmPelsHeight);
for (int j = 0; j < numRatios; ++j)
if (fabs((float)deviceMode.dmPelsWidth / (float)deviceMode.dmPelsHeight
- (float)ratios[j].x / (float)ratios[j].y) < 0.005f) {
snprintf(text, 128, "%s (%s)", text, ratios[j].description);
break;
}
_listResolutions.push_back(text);
if ((fullscreen.selected.width == deviceMode.dmPelsWidth) &&
(fullscreen.selected.height == deviceMode.dmPelsHeight))
_resolutionIdx = fullscreen.numResolutions;
++fullscreen.numResolutions;
}
}
_fillFullscreenRefreshRateList(_listRefreshRates, _rateIdx);
}
void fillFullscreenRefreshRateList(int _resolutionIdx, StringList & _listRefreshRates, int & _rateIdx)
{
fullscreen.selected.width = fullscreen.resolution[_resolutionIdx].width;
fullscreen.selected.height = fullscreen.resolution[_resolutionIdx].height;
_fillFullscreenRefreshRateList(_listRefreshRates, _rateIdx);
_rateIdx = fullscreen.numRefreshRates - 1;
}
void getFullscreenResolutions(int _idx, unsigned int & _width, unsigned int & _height)
{
_width = fullscreen.resolution[_idx].width;
_height = fullscreen.resolution[_idx].height;
}
void getFullscreenRefreshRate(int _idx, unsigned int & _rate)
{
_rate = fullscreen.refreshRate[_idx];
}

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,52 +0,0 @@
/*
Copyright (c) 2012 Matt Janisz
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef TICPP_API_INCLUDED
#define TICPP_API_INCLUDED
#undef TICPP_API
#if defined(_WIN32) | defined(WIN32) | defined(WINDOWS) | defined(_WINDOWS)
// define BUILD_TICPP_DLL when building TiCPP dll.
#ifdef BUILD_TICPP_DLL
#define TICPP_API __declspec(dllexport)
#endif
// define TICPP_DLL when linking TiCPP dll.
#ifdef TICPP_DLL
#define TICPP_API __declspec(dllimport)
#endif
// Disable dll-interface warning
#ifdef TICPP_API
#pragma warning( push )
#pragma warning( disable : 4251 ) // X needs to have dll-interface to be used by clients of class Y
#pragma warning( disable : 4275 ) // X is derived from class Y but only X is exported
#endif
#endif
#ifndef TICPP_API
//linux or windows-static library defines
#define TICPP_API
#endif
#endif // TICPP_API_INCLUDED

View File

@ -1,129 +0,0 @@
/*
http://code.google.com/p/ticpp/
Copyright (c) 2006 Ryan Pusztai, Ryan Mulder
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/*
* THIS FILE WAS ALTERED BY Matt Janisz, 12. October 2012.
*
* - added ticppapi.h include and TICPP_API dll-interface to support building DLL using VS200X
*/
#ifdef TIXML_USE_TICPP
#ifndef TICPPRC_INCLUDED
#define TICPPRC_INCLUDED
#include "ticppapi.h"
#include <vector>
// Forward declare ticpp::Node, so it can be made a friend of TiCppRC
namespace ticpp
{
class TICPP_API Base;
}
// Forward declare TiCppRCImp so TiCppRC can hold a pointer to it
class TICPP_API TiCppRCImp;
/**
Base class for reference counting functionality
*/
class TICPP_API TiCppRC
{
// Allow ticpp::Node to directly modify reference count
friend class ticpp::Base;
private:
TiCppRCImp* m_tiRC; /**< Pointer to reference counter */
public:
/**
Constructor
Spawns new reference counter with a pointer to this
*/
TiCppRC();
/**
Destructor
Nullifies the pointer to this held by the reference counter
Decrements reference count
*/
virtual ~TiCppRC();
std::vector< ticpp::Base* > m_spawnedWrappers; /**< Remember all wrappers that we've created with 'new' - ( e.g. NodeFactory, FirstChildElement, etc. )*/
/**
Delete all container objects we've spawned with 'new'.
*/
void DeleteSpawnedWrappers();
};
class TICPP_API TiCppRCImp
{
private:
int m_count; /**< Holds reference count to me, and to the node I point to */
TiCppRC* m_tiCppRC; /**< Holds pointer to an object inheriting TiCppRC */
public:
/**
Initializes m_tiCppRC pointer, and set reference count to 1
*/
TiCppRCImp( TiCppRC* tiCppRC );
/**
Allows the TiCppRC object to set the pointer to itself ( m_tiCppRc ) to NULL when the TiCppRC object is deleted
*/
void Nullify();
/**
Increment Reference Count
*/
void IncRef();
/**
Decrement Reference Count
*/
void DecRef();
/**
Set Reference Count to 1 - dangerous! - Use only if you are sure of the consequences
*/
void InitRef();
/**
Get internal pointer to the TiCppRC object - not reference counted, use at your own risk
*/
TiCppRC* Get();
/**
Returns state of internal pointer - will be null if the object was deleted
*/
bool IsNull();
};
#endif // TICPP_INCLUDED
#endif // TIXML_USE_TICPP

View File

@ -1,116 +0,0 @@
/*
www.sourceforge.net/projects/tinyxml
Original file by Yves Berquin.
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any
damages arising from the use of this software.
Permission is granted to anyone to use this software for any
purpose, including commercial applications, and to alter it and
redistribute it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and
must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source
distribution.
*/
/*
* THIS FILE WAS ALTERED BY Tyge Løvset, 7. April 2005.
*/
#ifndef TIXML_USE_STL
#include "tinystr.h"
// Error value for find primitive
const TiXmlString::size_type TiXmlString::npos = static_cast< TiXmlString::size_type >(-1);
// Null rep.
TiXmlString::Rep TiXmlString::nullrep_ = { 0, 0, { '\0' } };
void TiXmlString::reserve (size_type cap)
{
if (cap > capacity())
{
TiXmlString tmp;
tmp.init(length(), cap);
memcpy(tmp.start(), data(), length());
swap(tmp);
}
}
TiXmlString& TiXmlString::assign(const char* str, size_type len)
{
size_type cap = capacity();
if (len > cap || cap > 3*(len + 8))
{
TiXmlString tmp;
tmp.init(len);
memcpy(tmp.start(), str, len);
swap(tmp);
}
else
{
memmove(start(), str, len);
set_size(len);
}
return *this;
}
TiXmlString& TiXmlString::append(const char* str, size_type len)
{
size_type newsize = length() + len;
if (newsize > capacity())
{
reserve (newsize + capacity());
}
memmove(finish(), str, len);
set_size(newsize);
return *this;
}
TiXmlString operator + (const TiXmlString & a, const TiXmlString & b)
{
TiXmlString tmp;
tmp.reserve(a.length() + b.length());
tmp += a;
tmp += b;
return tmp;
}
TiXmlString operator + (const TiXmlString & a, const char* b)
{
TiXmlString tmp;
TiXmlString::size_type b_len = static_cast<TiXmlString::size_type>( strlen(b) );
tmp.reserve(a.length() + b_len);
tmp += a;
tmp.append(b, b_len);
return tmp;
}
TiXmlString operator + (const char* a, const TiXmlString & b)
{
TiXmlString tmp;
TiXmlString::size_type a_len = static_cast<TiXmlString::size_type>( strlen(a) );
tmp.reserve(a_len + b.length());
tmp.append(a, a_len);
tmp += b;
return tmp;
}
#endif // TIXML_USE_STL

View File

@ -1,326 +0,0 @@
/*
www.sourceforge.net/projects/tinyxml
Original file by Yves Berquin.
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any
damages arising from the use of this software.
Permission is granted to anyone to use this software for any
purpose, including commercial applications, and to alter it and
redistribute it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and
must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source
distribution.
*/
/*
* THIS FILE WAS ALTERED BY Tyge Lovset, 7. April 2005.
*
* - completely rewritten. compact, clean, and fast implementation.
* - sizeof(TiXmlString) = pointer size (4 bytes on 32-bit systems)
* - fixed reserve() to work as per specification.
* - fixed buggy compares operator==(), operator<(), and operator>()
* - fixed operator+=() to take a const ref argument, following spec.
* - added "copy" constructor with length, and most compare operators.
* - added swap(), clear(), size(), capacity(), operator+().
*/
/*
* THIS FILE WAS ALTERED BY Matt Janisz, 12. October 2012.
*
* - added ticppapi.h include and TICPP_API dll-interface to support building DLL using VS200X
*/
#ifndef TIXML_USE_STL
#ifndef TIXML_STRING_INCLUDED
#define TIXML_STRING_INCLUDED
#include "ticppapi.h"
#include <assert.h>
#include <string.h>
/* The support for explicit isn't that universal, and it isn't really
required - it is used to check that the TiXmlString class isn't incorrectly
used. Be nice to old compilers and macro it here:
*/
#if defined(_MSC_VER) && (_MSC_VER >= 1200 )
// Microsoft visual studio, version 6 and higher.
#define TIXML_EXPLICIT explicit
#elif defined(__GNUC__) && (__GNUC__ >= 3 )
// GCC version 3 and higher.s
#define TIXML_EXPLICIT explicit
#else
#define TIXML_EXPLICIT
#endif
/*
TiXmlString is an emulation of a subset of the std::string template.
Its purpose is to allow compiling TinyXML on compilers with no or poor STL support.
Only the member functions relevant to the TinyXML project have been implemented.
The buffer allocation is made by a simplistic power of 2 like mechanism : if we increase
a string and there's no more room, we allocate a buffer twice as big as we need.
*/
class TICPP_API TiXmlString
{
public :
// The size type used
typedef size_t size_type;
// Error value for find primitive
static const size_type npos; // = -1;
// TiXmlString empty constructor
TiXmlString () : rep_(&nullrep_)
{
}
// TiXmlString copy constructor
TiXmlString ( const TiXmlString & copy) : rep_(0)
{
init(copy.length());
memcpy(start(), copy.data(), length());
}
// TiXmlString constructor, based on a string
TIXML_EXPLICIT TiXmlString ( const char * copy) : rep_(0)
{
init( static_cast<size_type>( strlen(copy) ));
memcpy(start(), copy, length());
}
// TiXmlString constructor, based on a string
TIXML_EXPLICIT TiXmlString ( const char * str, size_type len) : rep_(0)
{
init(len);
memcpy(start(), str, len);
}
// TiXmlString destructor
~TiXmlString ()
{
quit();
}
// = operator
TiXmlString& operator = (const char * copy)
{
return assign( copy, (size_type)strlen(copy));
}
// = operator
TiXmlString& operator = (const TiXmlString & copy)
{
return assign(copy.start(), copy.length());
}
// += operator. Maps to append
TiXmlString& operator += (const char * suffix)
{
return append(suffix, static_cast<size_type>( strlen(suffix) ));
}
// += operator. Maps to append
TiXmlString& operator += (char single)
{
return append(&single, 1);
}
// += operator. Maps to append
TiXmlString& operator += (const TiXmlString & suffix)
{
return append(suffix.data(), suffix.length());
}
// Convert a TiXmlString into a null-terminated char *
const char * c_str () const { return rep_->str; }
// Convert a TiXmlString into a char * (need not be null terminated).
const char * data () const { return rep_->str; }
// Return the length of a TiXmlString
size_type length () const { return rep_->size; }
// Alias for length()
size_type size () const { return rep_->size; }
// Checks if a TiXmlString is empty
bool empty () const { return rep_->size == 0; }
// Return capacity of string
size_type capacity () const { return rep_->capacity; }
// single char extraction
const char& at (size_type index) const
{
assert( index < length() );
return rep_->str[ index ];
}
// [] operator
char& operator [] (size_type index) const
{
assert( index < length() );
return rep_->str[ index ];
}
// find a char in a string. Return TiXmlString::npos if not found
size_type find (char lookup) const
{
return find(lookup, 0);
}
// find a char in a string from an offset. Return TiXmlString::npos if not found
size_type find (char tofind, size_type offset) const
{
if (offset >= length()) return npos;
for (const char* p = c_str() + offset; *p != '\0'; ++p)
{
if (*p == tofind) return static_cast< size_type >( p - c_str() );
}
return npos;
}
void clear ()
{
//Lee:
//The original was just too strange, though correct:
// TiXmlString().swap(*this);
//Instead use the quit & re-init:
quit();
init(0,0);
}
/* Function to reserve a big amount of data when we know we'll need it. Be aware that this
function DOES NOT clear the content of the TiXmlString if any exists.
*/
void reserve (size_type cap);
TiXmlString& assign (const char* str, size_type len);
TiXmlString& append (const char* str, size_type len);
void swap (TiXmlString& other)
{
Rep* r = rep_;
rep_ = other.rep_;
other.rep_ = r;
}
private:
void init(size_type sz) { init(sz, sz); }
void set_size(size_type sz) { rep_->str[ rep_->size = sz ] = '\0'; }
char* start() const { return rep_->str; }
char* finish() const { return rep_->str + rep_->size; }
struct Rep
{
size_type size, capacity;
char str[1];
};
void init(size_type sz, size_type cap)
{
if (cap)
{
// Lee: the original form:
// rep_ = static_cast<Rep*>(operator new(sizeof(Rep) + cap));
// doesn't work in some cases of new being overloaded. Switching
// to the normal allocation, although use an 'int' for systems
// that are overly picky about structure alignment.
const size_type bytesNeeded = sizeof(Rep) + cap;
const size_type intsNeeded = ( bytesNeeded + sizeof(int) - 1 ) / sizeof( int );
rep_ = reinterpret_cast<Rep*>( new int[ intsNeeded ] );
rep_->str[ rep_->size = sz ] = '\0';
rep_->capacity = cap;
}
else
{
rep_ = &nullrep_;
}
}
void quit()
{
if (rep_ != &nullrep_)
{
// The rep_ is really an array of ints. (see the allocator, above).
// Cast it back before delete, so the compiler won't incorrectly call destructors.
delete [] ( reinterpret_cast<int*>( rep_ ) );
}
}
Rep * rep_;
static Rep nullrep_;
} ;
inline bool operator == (const TiXmlString & a, const TiXmlString & b)
{
return ( a.length() == b.length() ) // optimization on some platforms
&& ( strcmp(a.c_str(), b.c_str()) == 0 ); // actual compare
}
inline bool operator < (const TiXmlString & a, const TiXmlString & b)
{
return strcmp(a.c_str(), b.c_str()) < 0;
}
inline bool operator != (const TiXmlString & a, const TiXmlString & b) { return !(a == b); }
inline bool operator > (const TiXmlString & a, const TiXmlString & b) { return b < a; }
inline bool operator <= (const TiXmlString & a, const TiXmlString & b) { return !(b < a); }
inline bool operator >= (const TiXmlString & a, const TiXmlString & b) { return !(a < b); }
inline bool operator == (const TiXmlString & a, const char* b) { return strcmp(a.c_str(), b) == 0; }
inline bool operator == (const char* a, const TiXmlString & b) { return b == a; }
inline bool operator != (const TiXmlString & a, const char* b) { return !(a == b); }
inline bool operator != (const char* a, const TiXmlString & b) { return !(b == a); }
TiXmlString operator + (const TiXmlString & a, const TiXmlString & b);
TiXmlString operator + (const TiXmlString & a, const char* b);
TiXmlString operator + (const char* a, const TiXmlString & b);
/*
TiXmlOutStream is an emulation of std::ostream. It is based on TiXmlString.
Only the operators that we need for TinyXML have been developped.
*/
class TICPP_API TiXmlOutStream : public TiXmlString
{
public :
// TiXmlOutStream << operator.
TiXmlOutStream & operator << (const TiXmlString & in)
{
*this += in;
return *this;
}
// TiXmlOutStream << operator.
TiXmlOutStream & operator << (const char * in)
{
*this += in;
return *this;
}
} ;
#endif // TIXML_STRING_INCLUDED
#endif // TIXML_USE_STL

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,53 +0,0 @@
/*
www.sourceforge.net/projects/tinyxml
Original code (2.0 and earlier )copyright (c) 2000-2006 Lee Thomason (www.grinninglizard.com)
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any
damages arising from the use of this software.
Permission is granted to anyone to use this software for any
purpose, including commercial applications, and to alter it and
redistribute it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and
must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source
distribution.
*/
#include "tinyxml.h"
// The goal of the seperate error file is to make the first
// step towards localization. tinyxml (currently) only supports
// english error messages, but the could now be translated.
//
// It also cleans up the code a bit.
//
const char* TiXmlBase::errorString[ TIXML_ERROR_STRING_COUNT ] =
{
"No error",
"Error",
"Failed to open file",
"Memory allocation failed.",
"Error parsing Element.",
"Failed to read Element name",
"Error reading Element value.",
"Error reading Attributes.",
"Error: empty tag.",
"Error reading end tag.",
"Error parsing Unknown.",
"Error parsing Comment.",
"Error parsing Declaration.",
"Error document empty.",
"Error null (0) or unexpected EOF found in input stream.",
"Error parsing CDATA.",
"Error when TiXmlDocument added to document, because TiXmlDocument can only be at the root.",
};

File diff suppressed because it is too large Load Diff

View File

@ -1,283 +0,0 @@
#include "StdString.h"
#include <malloc.h>
#include <algorithm>
#ifdef _WIN32
#include <Windows.h>
#endif
stdstr::stdstr()
{
}
stdstr::stdstr(const std::string & str) :
std::string(str)
{
}
stdstr::stdstr(const stdstr & str) :
std::string((const std::string &)str)
{
}
stdstr::stdstr(const char * str) :
std::string(str ? str : "")
{
}
strvector stdstr::Tokenize(const char * delimiter) const
{
strvector tokens;
stdstr::size_type lastPos = find_first_not_of(delimiter, 0);
stdstr::size_type pos = find_first_of(delimiter, lastPos);
while (stdstr::npos != pos)
{
tokens.push_back(substr(lastPos, pos - lastPos));
lastPos = pos + 1;
pos = find_first_of(delimiter, lastPos);
}
if (stdstr::npos != lastPos)
{
tokens.push_back(substr(lastPos));
}
return tokens;
}
strvector stdstr::Tokenize(char delimiter) const
{
strvector tokens;
stdstr::size_type lastPos = find_first_not_of(delimiter, 0);
stdstr::size_type pos = find_first_of(delimiter, lastPos);
while (stdstr::npos != pos)
{
tokens.push_back(substr(lastPos, pos - lastPos));
lastPos = pos + 1;
pos = find_first_of(delimiter, lastPos);
}
if (stdstr::npos != lastPos)
{
tokens.push_back(substr(lastPos));
}
return tokens;
}
void stdstr::ArgFormat(const char * strFormat, va_list & args)
{
#pragma warning(push)
#pragma warning(disable:4996)
size_t nlen = _vscprintf(strFormat, args) + 1;
char * buffer = (char *)alloca(nlen * sizeof(char));
buffer[nlen - 1] = 0;
if (buffer != NULL)
{
vsprintf(buffer, strFormat, args);
*this = buffer;
}
#pragma warning(pop)
}
void stdstr::Format(const char * strFormat, ...)
{
va_list args;
va_start(args, strFormat);
ArgFormat(strFormat, args);
va_end(args);
}
stdstr& stdstr::ToLower(void)
{
std::transform(begin(), end(), begin(), (int(*)(int)) tolower);
return *this;
}
stdstr& stdstr::ToUpper(void)
{
std::transform(begin(), end(), begin(), (int(*)(int)) toupper);
return *this;
}
void stdstr::Replace(const char search, const char replace)
{
std::string& str = *this;
std::string::size_type pos = str.find(search);
while (pos != std::string::npos)
{
str.replace(pos, 1, &replace);
pos = str.find(search, pos + 1);
}
}
void stdstr::Replace(const char * search, const char replace)
{
std::string& str = *this;
std::string::size_type pos = str.find(search);
size_t SearchSize = strlen(search);
while (pos != std::string::npos)
{
str.replace(pos, SearchSize, &replace);
pos = str.find(search, pos + 1);
}
}
void stdstr::Replace(const std::string& search, const std::string& replace)
{
std::string& str = *this;
std::string::size_type pos = str.find(search);
size_t SearchSize = search.size();
while (pos != std::string::npos)
{
str.replace(pos, SearchSize, replace);
pos = str.find(search, pos + replace.length());
}
}
stdstr & stdstr::TrimLeft(const char * chars2remove)
{
if (!empty())
{
std::string::size_type pos = find_first_not_of(chars2remove);
if (pos != std::string::npos)
{
erase(0, pos);
}
else
{
erase(begin(), end()); // make empty
}
}
return *this;
}
stdstr & stdstr::TrimRight(const char * chars2remove)
{
if (!empty())
{
std::string::size_type pos = find_last_not_of(chars2remove);
if (pos != std::string::npos)
{
erase(pos + 1);
}
else
{
erase(begin(), end()); // make empty
}
}
return *this;
}
stdstr & stdstr::Trim(const char * chars2remove)
{
if (!empty())
{
std::string::size_type pos = find_first_not_of(chars2remove);
if (pos != std::string::npos)
{
erase(0, pos);
}
else
{
erase(begin(), end()); // make empty
}
pos = find_last_not_of(chars2remove);
if (pos != std::string::npos)
{
erase(pos + 1);
}
else
{
erase(begin(), end()); // make empty
}
}
return *this;
}
#ifdef _WIN32
stdstr & stdstr::FromUTF16(const wchar_t * UTF16Source, bool * bSuccess)
{
bool bConverted = false;
if (UTF16Source == NULL)
{
*this = "";
bConverted = true;
}
else if (wcslen(UTF16Source) > 0)
{
uint32_t nNeeded = WideCharToMultiByte(CODEPAGE_UTF8, 0, UTF16Source, -1, NULL, 0, NULL, NULL);
if (nNeeded > 0)
{
char * buf = (char *)alloca(nNeeded + 1);
if (buf != NULL)
{
memset(buf, 0, nNeeded + 1);
nNeeded = WideCharToMultiByte(CODEPAGE_UTF8, 0, UTF16Source, -1, buf, nNeeded, NULL, NULL);
if (nNeeded)
{
*this = buf;
bConverted = true;
}
}
}
}
if (bSuccess)
{
*bSuccess = bConverted;
}
return *this;
}
std::wstring stdstr::ToUTF16(unsigned int CodePage, bool * bSuccess)
{
bool bConverted = false;
std::wstring res;
DWORD nNeeded = MultiByteToWideChar(CodePage, 0, this->c_str(), (int)this->length(), NULL, 0);
if (nNeeded > 0)
{
wchar_t * buf = (wchar_t *)alloca((nNeeded + 1) * sizeof(wchar_t));
if (buf != NULL)
{
memset(buf, 0, (nNeeded + 1) * sizeof(wchar_t));
nNeeded = MultiByteToWideChar(CodePage, 0, this->c_str(), (int)this->length(), buf, nNeeded);
if (nNeeded)
{
res = buf;
bConverted = true;
}
}
}
if (bSuccess)
{
*bSuccess = bConverted;
}
return res;
}
#endif
stdstr_f::stdstr_f(const char * strFormat, ...)
{
va_list args;
va_start(args, strFormat);
ArgFormat(strFormat, args);
va_end(args);
}
#ifdef _WIN32
stdwstr_f::stdwstr_f(const wchar_t * strFormat, ...)
{
va_list args;
va_start(args, strFormat);
wchar_t Msg[1000];
_vsnwprintf(Msg, sizeof(Msg) - 1, strFormat, args);
va_end(args);
this->assign(Msg);
}
#endif

View File

@ -1,64 +0,0 @@
#pragma once
class stdstr;
#include <stdarg.h>
#include <vector>
#include <string>
#include <list>
typedef std::vector<stdstr> strvector;
class stdstr :
public std::string
{
public:
enum
{
CODEPAGE_UTF8 = 65001,
CODEPAGE_932 = 932,
};
stdstr();
stdstr(const std::string & str);
stdstr(const stdstr & str);
stdstr(const char * str);
strvector Tokenize(char delimiter) const;
strvector Tokenize(const char * delimiter) const;
void Format(const char * strFormat, ...);
stdstr& ToLower(void);
stdstr& ToUpper(void);
void Replace(const char search, const char replace);
void Replace(const char * search, const char replace);
void Replace(const std::string & search, const std::string & replace);
stdstr & Trim(const char * chars2remove = "\t ");
stdstr & TrimLeft(const char * chars2remove = "\t ");
stdstr & TrimRight(const char * chars2remove = "\t ");
#ifdef _WIN32
stdstr & FromUTF16(const wchar_t * UTF16Source, bool * bSuccess = NULL);
std::wstring ToUTF16(unsigned int CodePage = CODEPAGE_UTF8, bool * bSuccess = NULL);
#endif
void ArgFormat(const char * strFormat, va_list & args);
};
class stdstr_f : public stdstr
{
public:
stdstr_f(const char * strFormat, ...);
};
#ifdef _WIN32
class stdwstr_f : public std::wstring
{
public:
stdwstr_f(const wchar_t * strFormat, ... );
};
#endif
typedef std::list<stdstr> strlist;
typedef strlist::iterator strlist_iter;

View File

@ -1,481 +0,0 @@
// MD5.CC - source code for the C++/object oriented translation and
// modification of MD5.
// Translation and modification (c) 1995 by Mordechai T. Abzug
// This translation/ modification is provided "as is," without express or
// implied warranty of any kind.
// The translator/ modifier does not claim (1) that MD5 will do what you think
// it does; (2) that this translation/ modification is accurate; or (3) that
// this software is "merchantible." (Language for this disclaimer partially
// copied from the disclaimer below).
/* based on:
MD5C.C - RSA Data Security, Inc., MD5 message-digest algorithm
MDDRIVER.C - test driver for MD2, MD4 and MD5
Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
rights reserved.
License to copy and use this software is granted provided that it
is identified as the "RSA Data Security, Inc. MD5 Message-Digest
Algorithm" in all material mentioning or referencing this software
or this function.
License is also granted to make and use derivative works provided
that such works are identified as "derived from the RSA Data
Security, Inc. MD5 Message-Digest Algorithm" in all material
mentioning or referencing the derived work.
RSA Data Security, Inc. makes no representations concerning either
the merchantability of this software or the suitability of this
software for any particular purpose. It is provided "as is"
without express or implied warranty of any kind.
These notices must be retained in any copies of any part of this
documentation and/or software.
*/
#include "md5.h"
// MD5 simple initialization method
MD5::MD5()
{
init();
}
MD5::~MD5()
{
}
// MD5 block update operation. Continues an MD5 message-digest
// operation, processing another message block, and updating the
// context.
void MD5::update(const uint1 *input, uint4 input_length)
{
uint4 input_index, buffer_index;
uint4 buffer_space; // how much space is left in buffer
if (finalized) // so we can't update!
{
//WriteTrace(TraceMD5, TraceError, "Can't update a finalized digest!");
return;
}
// Compute number of bytes mod 64
buffer_index = (unsigned int)((count[0] >> 3) & 0x3F);
// Update number of bits
if ((count[0] += ((uint4)input_length << 3)) < ((uint4)input_length << 3))
{
count[1]++;
}
count[1] += ((uint4)input_length >> 29);
buffer_space = 64 - buffer_index; // how much space is left in buffer
// Transform as many times as possible.
if (input_length >= buffer_space) // ie. we have enough to fill the buffer
{
// fill the rest of the buffer and transform
memcpy(buffer + buffer_index, (unsigned char *)input, buffer_space);
transform(buffer);
// now, transform each 64-byte piece of the input, bypassing the buffer
for (input_index = buffer_space; input_index + 63 < input_length; input_index += 64)
{
transform((unsigned char *)(input + input_index));
}
buffer_index = 0; // so we can buffer remaining
}
else
{
input_index = 0; // so we can buffer the whole input
}
// and here we do the buffering:
memcpy(buffer + buffer_index, (unsigned char *)(input + input_index), input_length - input_index);
}
// MD5 update for files.
// Like above, except that it works on files (and uses above as a primitive.)
void MD5::update(FILE *file)
{
unsigned char buffer[1024];
int len;
do
{
len = (int)fread(buffer, 1, 1024, file);
if (len)
{
update(buffer, len);
}
} while (len);
fclose(file);
}
// MD5 finalization. Ends an MD5 message-digest operation, writing the
// the message digest and zeroizing the context.
void MD5::finalize()
{
unsigned char bits[8];
unsigned int index, padLen;
static uint1 PADDING[64] =
{
0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
if (finalized)
{
//WriteTrace(TraceMD5, TraceError, "Already finalized this digest!");
return;
}
// Save number of bits
encode(bits, count, 8);
// Pad out to 56 mod 64.
index = (uint4)((count[0] >> 3) & 0x3f);
padLen = (index < 56) ? (56 - index) : (120 - index);
update(PADDING, padLen);
// Append length (before padding)
update(bits, 8);
// Store state in digest
encode(digest, state, 16);
// Zeroize sensitive information
memset(buffer, 0, sizeof(*buffer));
finalized = 1;
}
MD5::MD5(CPath File)
{
init(); // must be called be all constructors
if (File.Exists())
{
FILE * fp = fopen((const char *)File, "rb");
if (fp)
{
update(fp);
}
}
finalize();
}
MD5::MD5(FILE *file)
{
init(); // must be called be all constructors
update(file);
finalize();
}
MD5::MD5(const unsigned char *input, unsigned int input_length)
{
init(); // must called by all constructors
update(input, input_length);
finalize();
}
MD5::MD5(const stdstr & string)
{
init(); // must called by all constructors
update((const unsigned char *)string.c_str(), string.length());
finalize();
}
const unsigned char *MD5::raw_digest()
{
if (!finalized)
{
//WriteTrace(TraceMD5, TraceError, "Can't get digest if you haven't finalized the digest!");
return ((unsigned char*) "");
}
return digest;
}
void MD5::get_digest(MD5Digest& extdigest)
{
if (!finalized)
{
//WriteTrace(TraceMD5, TraceError, "Can't get digest if you haven't finalized the digest!");
memset(extdigest.digest, 0, sizeof(extdigest.digest));
return;
}
memcpy(extdigest.digest, digest, 16);
}
const char *MD5::hex_digest()
{
if (m_hex_digest.length())
{
return m_hex_digest.c_str();
}
if (!finalized)
{
//WriteTrace(TraceMD5, TraceError, "Can't get digest if you haven't finalized the digest!");
return "";
}
char c[33];
memset((unsigned char *)c, 0, 33);
for (int i = 0; i < 16; i++)
{
sprintf(c + i * 2, "%02X", digest[i]);
}
c[32] = '\0';
m_hex_digest = c;
return m_hex_digest.c_str();
}
// PRIVATE METHODS:
void MD5::init()
{
finalized = 0; // we just started!
// Nothing counted, so count=0
count[0] = 0;
count[1] = 0;
// Load magic initialization constants.
state[0] = 0x67452301;
state[1] = 0xefcdab89;
state[2] = 0x98badcfe;
state[3] = 0x10325476;
::memset(digest, 0, sizeof(digest));
::memset(buffer, 0, sizeof(buffer));
m_hex_digest = NULL;
}
// Constants for MD5Transform routine.
// Although we could use C++ style constants, defines are actually better,
// since they let us easily evade scope clashes.
#define S11 7
#define S12 12
#define S13 17
#define S14 22
#define S21 5
#define S22 9
#define S23 14
#define S24 20
#define S31 4
#define S32 11
#define S33 16
#define S34 23
#define S41 6
#define S42 10
#define S43 15
#define S44 21
// MD5 basic transformation. Transforms state based on block.
void MD5::transform(uint1 block[64])
{
uint4 a = state[0], b = state[1], c = state[2], d = state[3], x[16];
decode(x, block, 64);
//ATLASSERT(!finalized); // not just a user error, since the method is private
/* Round 1 */
FF(a, b, c, d, x[0], S11, 0xd76aa478); /* 1 */
FF(d, a, b, c, x[1], S12, 0xe8c7b756); /* 2 */
FF(c, d, a, b, x[2], S13, 0x242070db); /* 3 */
FF(b, c, d, a, x[3], S14, 0xc1bdceee); /* 4 */
FF(a, b, c, d, x[4], S11, 0xf57c0faf); /* 5 */
FF(d, a, b, c, x[5], S12, 0x4787c62a); /* 6 */
FF(c, d, a, b, x[6], S13, 0xa8304613); /* 7 */
FF(b, c, d, a, x[7], S14, 0xfd469501); /* 8 */
FF(a, b, c, d, x[8], S11, 0x698098d8); /* 9 */
FF(d, a, b, c, x[9], S12, 0x8b44f7af); /* 10 */
FF(c, d, a, b, x[10], S13, 0xffff5bb1); /* 11 */
FF(b, c, d, a, x[11], S14, 0x895cd7be); /* 12 */
FF(a, b, c, d, x[12], S11, 0x6b901122); /* 13 */
FF(d, a, b, c, x[13], S12, 0xfd987193); /* 14 */
FF(c, d, a, b, x[14], S13, 0xa679438e); /* 15 */
FF(b, c, d, a, x[15], S14, 0x49b40821); /* 16 */
/* Round 2 */
GG(a, b, c, d, x[1], S21, 0xf61e2562); /* 17 */
GG(d, a, b, c, x[6], S22, 0xc040b340); /* 18 */
GG(c, d, a, b, x[11], S23, 0x265e5a51); /* 19 */
GG(b, c, d, a, x[0], S24, 0xe9b6c7aa); /* 20 */
GG(a, b, c, d, x[5], S21, 0xd62f105d); /* 21 */
GG(d, a, b, c, x[10], S22, 0x2441453); /* 22 */
GG(c, d, a, b, x[15], S23, 0xd8a1e681); /* 23 */
GG(b, c, d, a, x[4], S24, 0xe7d3fbc8); /* 24 */
GG(a, b, c, d, x[9], S21, 0x21e1cde6); /* 25 */
GG(d, a, b, c, x[14], S22, 0xc33707d6); /* 26 */
GG(c, d, a, b, x[3], S23, 0xf4d50d87); /* 27 */
GG(b, c, d, a, x[8], S24, 0x455a14ed); /* 28 */
GG(a, b, c, d, x[13], S21, 0xa9e3e905); /* 29 */
GG(d, a, b, c, x[2], S22, 0xfcefa3f8); /* 30 */
GG(c, d, a, b, x[7], S23, 0x676f02d9); /* 31 */
GG(b, c, d, a, x[12], S24, 0x8d2a4c8a); /* 32 */
/* Round 3 */
HH(a, b, c, d, x[5], S31, 0xfffa3942); /* 33 */
HH(d, a, b, c, x[8], S32, 0x8771f681); /* 34 */
HH(c, d, a, b, x[11], S33, 0x6d9d6122); /* 35 */
HH(b, c, d, a, x[14], S34, 0xfde5380c); /* 36 */
HH(a, b, c, d, x[1], S31, 0xa4beea44); /* 37 */
HH(d, a, b, c, x[4], S32, 0x4bdecfa9); /* 38 */
HH(c, d, a, b, x[7], S33, 0xf6bb4b60); /* 39 */
HH(b, c, d, a, x[10], S34, 0xbebfbc70); /* 40 */
HH(a, b, c, d, x[13], S31, 0x289b7ec6); /* 41 */
HH(d, a, b, c, x[0], S32, 0xeaa127fa); /* 42 */
HH(c, d, a, b, x[3], S33, 0xd4ef3085); /* 43 */
HH(b, c, d, a, x[6], S34, 0x4881d05); /* 44 */
HH(a, b, c, d, x[9], S31, 0xd9d4d039); /* 45 */
HH(d, a, b, c, x[12], S32, 0xe6db99e5); /* 46 */
HH(c, d, a, b, x[15], S33, 0x1fa27cf8); /* 47 */
HH(b, c, d, a, x[2], S34, 0xc4ac5665); /* 48 */
/* Round 4 */
II(a, b, c, d, x[0], S41, 0xf4292244); /* 49 */
II(d, a, b, c, x[7], S42, 0x432aff97); /* 50 */
II(c, d, a, b, x[14], S43, 0xab9423a7); /* 51 */
II(b, c, d, a, x[5], S44, 0xfc93a039); /* 52 */
II(a, b, c, d, x[12], S41, 0x655b59c3); /* 53 */
II(d, a, b, c, x[3], S42, 0x8f0ccc92); /* 54 */
II(c, d, a, b, x[10], S43, 0xffeff47d); /* 55 */
II(b, c, d, a, x[1], S44, 0x85845dd1); /* 56 */
II(a, b, c, d, x[8], S41, 0x6fa87e4f); /* 57 */
II(d, a, b, c, x[15], S42, 0xfe2ce6e0); /* 58 */
II(c, d, a, b, x[6], S43, 0xa3014314); /* 59 */
II(b, c, d, a, x[13], S44, 0x4e0811a1); /* 60 */
II(a, b, c, d, x[4], S41, 0xf7537e82); /* 61 */
II(d, a, b, c, x[11], S42, 0xbd3af235); /* 62 */
II(c, d, a, b, x[2], S43, 0x2ad7d2bb); /* 63 */
II(b, c, d, a, x[9], S44, 0xeb86d391); /* 64 */
state[0] += a;
state[1] += b;
state[2] += c;
state[3] += d;
// Zeroize sensitive information.
memset((uint1 *)x, 0, sizeof(x));
}
// Encodes input (UINT4) into output (unsigned char). Assumes len is
// a multiple of 4.
void MD5::encode(uint1 *output, uint4 *input, uint4 len)
{
unsigned int i, j;
for (i = 0, j = 0; j < len; i++, j += 4)
{
output[j] = (uint1)(input[i] & 0xff);
output[j + 1] = (uint1)((input[i] >> 8) & 0xff);
output[j + 2] = (uint1)((input[i] >> 16) & 0xff);
output[j + 3] = (uint1)((input[i] >> 24) & 0xff);
}
}
// Decodes input (unsigned char) into output (UINT4). Assumes len is
// a multiple of 4.
void MD5::decode(uint4 *output, uint1 *input, uint4 len)
{
unsigned int i, j;
for (i = 0, j = 0; j < len; i++, j += 4)
{
output[i] = ((uint4)input[j]) | (((uint4)input[j + 1]) << 8) | (((uint4)input[j + 2]) << 16) | (((uint4)input[j + 3]) << 24);
}
}
// Note: Replace "for loop" with standard memcpy if possible.
void MD5::memcpy(uint1 *output, uint1 *input, uint4 len)
{
unsigned int i;
for (i = 0; i < len; i++)
{
output[i] = input[i];
}
}
// Note: Replace "for loop" with standard memset if possible.
void MD5::memset(uint1 *output, uint1 value, uint4 len)
{
unsigned int i;
for (i = 0; i < len; i++)
{
output[i] = value;
}
}
// ROTATE_LEFT rotates x left n bits.
inline unsigned int MD5::rotate_left(uint4 x, uint4 n)
{
return (x << n) | (x >> (32 - n));
}
// F, G, H and I are basic MD5 functions.
inline unsigned int MD5::F(uint4 x, uint4 y, uint4 z)
{
return (x & y) | (~x & z);
}
inline unsigned int MD5::G(uint4 x, uint4 y, uint4 z)
{
return (x & z) | (y & ~z);
}
inline unsigned int MD5::H(uint4 x, uint4 y, uint4 z)
{
return x ^ y ^ z;
}
inline unsigned int MD5::I(uint4 x, uint4 y, uint4 z)
{
return y ^ (x | ~z);
}
// FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4.
// Rotation is separate from addition to prevent recomputation.
inline void MD5::FF(uint4& a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac)
{
a += F(b, c, d) + x + ac;
a = rotate_left(a, s) + b;
}
inline void MD5::GG(uint4& a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac)
{
a += G(b, c, d) + x + ac;
a = rotate_left(a, s) + b;
}
inline void MD5::HH(uint4& a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac)
{
a += H(b, c, d) + x + ac;
a = rotate_left(a, s) + b;
}
inline void MD5::II(uint4& a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac)
{
a += I(b, c, d) + x + ac;
a = rotate_left(a, s) + b;
}

View File

@ -1,150 +0,0 @@
// MD5.CC - source code for the C++/object oriented translation and
// modification of MD5.
// Translation and modification (c) 1995 by Mordechai T. Abzug
// This translation/ modification is provided "as is," without express or
// implied warranty of any kind.
// The translator/ modifier does not claim (1) that MD5 will do what you think
// it does; (2) that this translation/ modification is accurate; or (3) that
// this software is "merchantible." (Language for this disclaimer partially
// copied from the disclaimer below).
/* based on:
MD5.H - header file for MD5C.C
MDDRIVER.C - test driver for MD2, MD4 and MD5
Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
rights reserved.
License to copy and use this software is granted provided that it
is identified as the "RSA Data Security, Inc. MD5 Message-Digest
Algorithm" in all material mentioning or referencing this software
or this function.
License is also granted to make and use derivative works provided
that such works are identified as "derived from the RSA Data
Security, Inc. MD5 Message-Digest Algorithm" in all material
mentioning or referencing the derived work.
RSA Data Security, Inc. makes no representations concerning either
the merchantability of this software or the suitability of this
software for any particular purpose. It is provided "as is"
without express or implied warranty of any kind.
These notices must be retained in any copies of any part of this
documentation and/or software.
*/
#pragma once
#include <string.h>
#include <stdio.h>
#include <string>
#include <functional>
#include "path.h"
struct MD5Digest
{
MD5Digest() { Reset(); }
unsigned char digest[16];
void Reset() { ::memset(digest, 0, sizeof(digest)); }
bool IsClear()
{
int isClear = 0;
for (int i = 0; i < 16; i++)
{
isClear += digest[i];
}
return (isClear == 0);
}
std::string String(void)
{
char s[33];
::memset(s, 0, sizeof(s));
for (int i = 0; i < 16; i++)
{
sprintf(s + i * 2, "%02X", digest[i]);
}
s[32] = '\0';
return s;
}
};
struct MD5Digest_less
{
bool operator()(const MD5Digest& x, const MD5Digest& y) const
{
return (memcmp(x.digest, y.digest, sizeof(x.digest)) < 0);
}
};
class MD5
{
public:
// methods for controlled operation:
MD5(); // simple initializer
~MD5();
void update(const unsigned char *input, unsigned int input_length);
void update(FILE *file);
void finalize();
// constructors for special circumstances. All these constructors finalize
// the MD5 context.
MD5(CPath File); // digest File, finalize
MD5(const unsigned char *string); // digest string, finalize
MD5(FILE *file); // digest file, close, finalize
MD5(const unsigned char *input, unsigned int input_length);
MD5(const stdstr & string);
// methods to acquire finalized result
void get_digest(MD5Digest& extdigest); //Digest into a digest structure
const unsigned char *raw_digest(); // digest as a 16-byte binary array
const char * hex_digest(); // digest as a 33-byte ascii-hex string
private:
// first, some types:
typedef unsigned int uint4; // assumes integer is 4 words long
typedef unsigned short int uint2; // assumes short integer is 2 words long
typedef unsigned char uint1; // assumes char is 1 word long
// next, the private data:
uint4 state[4];
uint4 count[2]; // number of *bits*, mod 2^64
uint1 buffer[64]; // input buffer
uint1 digest[16];
uint1 finalized;
stdstr m_hex_digest;
// last, the private methods, mostly static:
void init(); // called by all constructors
void transform(uint1 *buffer); // does the real update work. Note
// that length is implied to be 64.
static void encode(uint1 *dest, uint4 *src, uint4 length);
static void decode(uint4 *dest, uint1 *src, uint4 length);
static void memcpy(uint1 *dest, uint1 *src, uint4 length);
static void memset(uint1 *start, uint1 val, uint4 length);
static inline uint4 rotate_left(uint4 x, uint4 n);
static inline uint4 F(uint4 x, uint4 y, uint4 z);
static inline uint4 G(uint4 x, uint4 y, uint4 z);
static inline uint4 H(uint4 x, uint4 y, uint4 z);
static inline uint4 I(uint4 x, uint4 y, uint4 z);
static inline void FF(uint4& a, uint4 b, uint4 c, uint4 d, uint4 x,
uint4 s, uint4 ac);
static inline void GG(uint4& a, uint4 b, uint4 c, uint4 d, uint4 x,
uint4 s, uint4 ac);
static inline void HH(uint4& a, uint4 b, uint4 c, uint4 d, uint4 x,
uint4 s, uint4 ac);
static inline void II(uint4& a, uint4 b, uint4 c, uint4 d, uint4 x,
uint4 s, uint4 ac);
};

File diff suppressed because it is too large Load Diff

View File

@ -1,165 +0,0 @@
#pragma once
#include <string>
#include <stdint.h>
#include "StdString.h"
class CPath
{
//Enums
public:
enum DIR_CURRENT_DIRECTORY { CURRENT_DIRECTORY = 1 };
#ifdef _WIN32
enum DIR_MODULE_DIRECTORY { MODULE_DIRECTORY = 2 };
enum DIR_MODULE_FILE { MODULE_FILE = 3 };
#endif
enum
{
FIND_ATTRIBUTE_ALLFILES = 0xFFFF, // Search Include all files
FIND_ATTRIBUTE_FILES = 0x0000, // File can be read or written to without restriction
FIND_ATTRIBUTE_SUBDIR = 0x0010, // Subdirectories
};
//Attributes
private:
std::string m_strPath;
#ifdef _WIN32
void * m_hFindFile;
static void * m_hInst;
#else
void * m_OpenedDir;
std::string m_FindWildcard;
#endif
uint32_t m_dwFindFileAttributes;
public:
//Methods
//Construction / destruction
CPath();
CPath(const CPath& rPath);
CPath(const char * lpszPath);
CPath(const char * lpszPath, const char * NameExten);
CPath(const std::string& strPath);
CPath(const std::string& strPath, const char * NameExten);
CPath(const std::string& strPath, const std::string& NameExten);
CPath(DIR_CURRENT_DIRECTORY sdt, const char * NameExten = NULL);
#ifdef _WIN32
CPath(DIR_MODULE_DIRECTORY sdt, const char * NameExten = NULL);
CPath(DIR_MODULE_FILE sdt);
#endif
virtual ~CPath();
//Operators
CPath& operator = (const CPath& rPath);
CPath& operator = (const char * lpszPath);
CPath& operator = (const std::string & strPath);
bool operator == (const CPath& rPath) const;
bool operator != (const CPath& rPath) const;
operator const char *() const;
operator const std::string &() { return m_strPath; }
//Get path components
#ifdef _WIN32
void GetDriveDirectory(std::string & rDriveDirectory) const;
std::string GetDriveDirectory(void) const;
#endif
void GetDirectory(std::string& rDirectory) const;
std::string GetDirectory(void) const;
void GetName(std::string& rName) const;
std::string GetName(void) const;
void GetNameExtension(std::string& rNameExtension) const;
std::string GetNameExtension(void) const;
void GetExtension(std::string& rExtension) const;
std::string GetExtension(void) const;
void GetLastDirectory(std::string& rDirectory) const;
std::string GetLastDirectory(void) const;
void GetFullyQualified(std::string& rFullyQualified) const;
#ifdef _WIN32
void GetComponents(std::string* pDrive = NULL, std::string* pDirectory = NULL, std::string* pName = NULL, std::string* pExtension = NULL) const;
#else
void GetComponents(std::string* pDirectory = NULL, std::string* pName = NULL, std::string* pExtension = NULL) const;
#endif
//Get other state
bool IsEmpty() const { return m_strPath.empty(); }
bool IsRelative() const;
//Set path components
#ifdef _WIN32
void SetDrive(char chDrive);
void SetDriveDirectory(const char * lpszDriveDirectory);
#endif
void SetDirectory(const char * lpszDirectory, bool bEnsureAbsolute = false);
void SetName(const char * lpszName);
void SetName(int iName);
void SetNameExtension(const char * lpszNameExtension);
void SetExtension(const char * lpszExtension);
void SetExtension(int iExtension);
void AppendDirectory(const char * lpszSubDirectory);
void UpDirectory(std::string* pLastDirectory = NULL);
#ifdef _WIN32
void SetComponents(const char * lpszDrive, const char * lpszDirectory, const char * lpszName, const char * lpszExtension);
#else
void SetComponents(const char * lpszDirectory, const char * lpszName, const char * lpszExtension);
#endif
//Set whole path
void Empty() { m_strPath.erase(); }
void CurrentDirectory();
#ifdef _WIN32
void Module();
void Module(void * hInstance);
void ModuleDirectory();
void ModuleDirectory(void * hInstance);
#endif
//Directory information
bool IsDirectory() const;
bool DirectoryExists() const;
//File Information
bool IsFile() const { return !IsDirectory(); }
bool Exists() const;
#ifdef _WIN32
bool SelectFile(void * hwndOwner, const char * InitialDir, const char * FileFilter, bool FileMustExist);
#endif
//Directory operations
bool DirectoryCreate(bool bCreateIntermediates = true);
bool ChangeDirectory();
void NormalizePath(CPath BaseDir);
//File operations
bool Delete(bool bEvenIfReadOnly = true) const;
bool CopyTo(const char * lpcszTargetFile, bool bOverwrite = true);
bool MoveTo(const char * lpcszTargetFile, bool bOverwrite = true);
//Finders
bool FindFirst(uint32_t dwAttributes = 0);
bool FindNext();
// Helpers
#ifdef _WIN32
static void SethInst(void * hInst);
static void * GethInst();
#endif
private:
//Setup & Cleanup
inline void Init();
inline void Exit();
bool AttributesMatch(uint32_t dwTargetAttributes, uint32_t dwFileAttributes);
void cleanPathString(std::string& rDirectory) const;
void StripLeadingChar(std::string& rText, char chLeading) const;
void StripLeadingBackslash(std::string& Directory) const;
void StripTrailingChar(std::string& rText, char chTrailing) const;
void StripTrailingBackslash(std::string& rDirectory) const;
void EnsureTrailingBackslash(std::string& Directory) const;
void EnsureLeadingBackslash(std::string& Directory) const;
#ifndef _WIN32
bool wildcmp(const char *wild, const char *string);
#endif
};

View File

@ -1,239 +0,0 @@
#include <windows.h>
#include "../Language.h"
#include "../ticpp/ticpp.h"
#include "path.h"
#include "md5.h"
#include "StdString.h"
#include <map>
#include <set>
#include <regex>
//#define DEBUG_LANG
typedef std::map<stdstr, stdstr> Translations;
std::string CleanString(std::string source)
{
stdstr value = source;
value.Replace("</p><p>", "\\n\\n");
value.Replace("<br/>", "\\n");
value.Replace("&quot;", "\\\"");
const std::regex re("<[^>]*>");
while (std::regex_search(value, re)) {
value = std::regex_replace(value, re, "");
}
value.Replace("\\n\\n\"", "\"");
value.Replace(stdstr().FromUTF16(L""), "-");
return value;
}
bool GetLangInfo(const char * filename, std::string & version, std::string & langCode, Translations & translations)
{
ticpp::Document doc(filename);
doc.LoadFile();
ticpp::Element * pElem = doc.FirstChildElement();
if (pElem == NULL)
{
return false;
}
if (pElem->Value() != "TS")
{
return false;
}
std::string text = pElem->GetText(false);
std::string elmValue = pElem->Value();
for (ticpp::Attribute* child = pElem->FirstAttribute(false); child; child = child->Next(false))
{
if (child->Name() == "version")
{
version = child->Value();
}
else if (child->Name() == "language")
{
langCode = child->Value();
}
}
if (version.empty() || langCode.empty())
{
return false;
}
for (ticpp::Element* childElement = pElem->FirstChildElement(false); childElement; childElement = childElement->NextSiblingElement(false))
{
if (childElement->Value() != "context")
{
continue;
}
for (ticpp::Element* contextElement = childElement->FirstChildElement(false); contextElement; contextElement = contextElement->NextSiblingElement(false))
{
if (contextElement->Value() != "message")
{
continue;
}
stdstr source, translation;
for (ticpp::Element* messageElement = contextElement->FirstChildElement(false); messageElement; messageElement = messageElement->NextSiblingElement(false))
{
if (messageElement->Value() == "source")
{
source = CleanString(messageElement->GetText());
}
else if (messageElement->Value() == "translation")
{
translation = CleanString(messageElement->GetText(false));
}
}
if (source.length() > 0 && translation.length() > 0)
{
translations.insert(Translations::value_type(source, translation));
}
}
}
return translations.size() > 0;
}
typedef std::map<int32_t, stdstr> ID_MAP;
typedef std::set<stdstr> ID_USED;
void WriteSection(FILE * file, const ID_MAP & defaultStrings, const Translations & hashedTranslations, ID_USED &usedTranslations, const char * sectionName, int32_t start, int32_t end)
{
std::string section;
for (int32_t id = start; id <= end; id++)
{
ID_MAP::const_iterator defaultStr_itr = defaultStrings.find(id);
if (defaultStr_itr == defaultStrings.end())
{
continue;
}
stdstr defaultStr = defaultStr_itr->second;
defaultStr.Replace("\n", "\\n"); //escape characters for comparison
defaultStr.Replace("\"", "\\\"");
stdstr matchingHash = MD5(defaultStr).hex_digest();
Translations::const_iterator translation_itr = hashedTranslations.find(matchingHash);
if (translation_itr == hashedTranslations.end())
{
continue;
}
usedTranslations.insert(matchingHash);
stdstr_f line("#%04d# \"%s\"\n", id, translation_itr->second.c_str());
section += line;
}
if (section.length() == 0)
{
return;
}
fprintf(file, "/*********************************************************************************\n");
fprintf(file, "* %-78s *\n", sectionName);
fprintf(file, "*********************************************************************************/\n");
fprintf(file, "%s\n", section.c_str());
}
bool WriteLangFile(const char * dstFile, const char * language, const Translations & translations, bool debugEnglish)
{
ID_MAP defaultStrings = (ID_MAP)GetDefaultStrings();
Translations hashedTranslations;
ID_USED usedTranslations;
for (Translations::const_iterator translation_itr = translations.begin(); translation_itr != translations.end(); translation_itr++)
{
std::string translation = debugEnglish ? translation_itr->first : translation_itr->second;
std::string key = MD5(translation_itr->first).hex_digest();
hashedTranslations.insert(Translations::value_type(key, translation));
}
FILE * file = NULL;
fopen_s(&file, dstFile, "wb");
if (file == NULL)
{
return false;
}
uint8_t utf_bom[3] = { 0xEF, 0xBB, 0xBF };
fwrite(utf_bom, sizeof(utf_bom), 1, file);
fprintf(file, "/*********************************************************************************\n");
fprintf(file, "* Meta Information *\n");
fprintf(file, "*********************************************************************************/\n");
fprintf(file, "#0001# \"%s\"\n\n", language);
WriteSection(file, defaultStrings, hashedTranslations, usedTranslations, "Config Dialog", 1000, 1999);
WriteSection(file, defaultStrings, hashedTranslations, usedTranslations, "Video Tab", 2000, 2999);
WriteSection(file, defaultStrings, hashedTranslations, usedTranslations, "Emulation Tab", 3000, 3999);
WriteSection(file, defaultStrings, hashedTranslations, usedTranslations, "Frame Buffer Tab", 4000, 4999);
WriteSection(file, defaultStrings, hashedTranslations, usedTranslations, "Texture enhancement", 5000, 5999);
WriteSection(file, defaultStrings, hashedTranslations, usedTranslations, "On-screen display", 6000, 6999);
WriteSection(file, defaultStrings, hashedTranslations, usedTranslations, "Debug", 7000, 7999);
WriteSection(file, defaultStrings, hashedTranslations, usedTranslations, "About", 9000, 9999);
for (ID_USED::const_iterator usedTranslation_itr = usedTranslations.begin(); usedTranslation_itr != usedTranslations.end(); usedTranslation_itr++)
{
Translations::iterator translation_itr = hashedTranslations.find(usedTranslation_itr->c_str());
if (translation_itr != hashedTranslations.end())
{
hashedTranslations.erase(translation_itr);
}
}
#ifdef DEBUG_LANG
if (hashedTranslations.size() > 0)
{
fprintf(file, "/*********************************************************************************\n");
fprintf(file, "* Untranslated Strings *\n");
fprintf(file, "*********************************************************************************/\n");
for (Translations::const_iterator translation_itr = hashedTranslations.begin(); translation_itr != hashedTranslations.end(); translation_itr++)
{
fprintf(file, "%s=\"%s\"\n", translation_itr->first.c_str(), translation_itr->second.c_str());
}
}
#endif
fclose(file);
return true;
}
int main()
{
if (__argc < 2)
{
return 0;
}
CPath src(__argv[1], "*.ts");
CPath dst(__argv[2], "");
if (!src.Exists())
{
return 0;
}
std::map<std::string, std::wstring> languages = {
{ "de_DE", L"Deutsch" },
{ "es_ES", L"Español" },
{ "fr_FR", L"Français" },
{ "it_IT", L"Italiano" },
{ "ja_JP", L"日本語" },
{ "pl_PL", L"Polski" },
{ "pt_BR", L"Português do Brasil" }
};
if (src.FindFirst())
{
do
{
Translations translations;
std::string version, langCode, language;
if (GetLangInfo(src, version, langCode, translations))
{
language = stdstr().FromUTF16(languages[langCode].c_str());
dst.SetName(src.GetName().c_str());
dst.SetExtension("Lang");
if (!WriteLangFile(dst, language.c_str(), translations, 0))
{
return false;
}
#ifdef DEBUG_LANG
if (langCode == "es_ES")
{
dst.SetName("gliden64_en");
dst.SetExtension("Lang");
WriteLangFile(dst, "English", translations, 1);
}
#endif
}
} while (src.FindNext());
}
return 0;
}

View File

@ -1,68 +0,0 @@
#include "wtl-BitmapPicture.h"
CBitmapPicture::CBitmapPicture() :
m_hBitmap(NULL),
m_nResourceID(-1),
m_ResourceIcon(false)
{
memset(&m_bmInfo, 0, sizeof(m_bmInfo));
m_BackgroundBrush.CreateSolidBrush(::GetSysColor(COLOR_3DFACE));
}
LRESULT CBitmapPicture::OnPaint(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL &/*bHandled*/)
{
CPaintDC dc(m_hWnd);
CRect rect;
GetClientRect(&rect);
CBrush PaintBrush;
HBRUSH OldBrush = dc.SelectBrush(m_BackgroundBrush);
dc.PatBlt(rect.left, rect.top, rect.Width(), rect.Height(), PATCOPY);
if (m_ResourceIcon)
{
CIcon hIcon = (HICON)::LoadImage(ModuleHelper::GetResourceInstance(), m_nResourceID > 0 ? MAKEINTRESOURCE(m_nResourceID) : m_strResourceName.c_str(), IMAGE_ICON, m_IconWidth, m_IconHeight, LR_DEFAULTCOLOR | LR_DEFAULTSIZE);
if (!hIcon.IsNull())
{
dc.DrawIconEx(0, 0, hIcon, rect.Width(), rect.Height(), 0, NULL, DI_NORMAL);
}
}
dc.SelectBrush(OldBrush);
return 0;
}
bool CBitmapPicture::SetIcon(LPCWSTR lpszResourceName, uint32_t nWidth, uint32_t nHeight)
{
CIcon hIcon = (HICON)::LoadImage(ModuleHelper::GetResourceInstance(), lpszResourceName > 0 ? MAKEINTRESOURCE(lpszResourceName) : lpszResourceName, IMAGE_ICON, nWidth, nHeight, LR_DEFAULTCOLOR | LR_DEFAULTSIZE);
if (hIcon.IsNull())
{
return false;
}
ICONINFO IconInfo;
if (!hIcon.GetIconInfo(&IconInfo))
{
return false;
}
if (IS_INTRESOURCE(lpszResourceName))
{
m_nResourceID = (int)lpszResourceName;
}
else
{
m_strResourceName = lpszResourceName;
}
m_ResourceIcon = true;
m_IconWidth = nWidth;
m_IconHeight = nHeight;
return true;
}
bool CBitmapPicture::SetBitmap(HBITMAP hBitmap)
{
m_hBitmap.Attach(hBitmap);
return ::GetObject(m_hBitmap, sizeof(BITMAP), &m_bmInfo) != 0;
}
void CBitmapPicture::SetBackroundBrush(HBRUSH brush)
{
m_BackgroundBrush.Attach(brush);
}

View File

@ -1,33 +0,0 @@
#pragma once
#include "wtl.h"
#include <string>
class CBitmapPicture :
public CWindowImpl <CBitmapPicture>
{
public:
BEGIN_MSG_MAP(CBitmapPicture)
MESSAGE_HANDLER(WM_PAINT, OnPaint);
END_MSG_MAP()
CBitmapPicture();
LRESULT OnPaint(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL &/*bHandled*/);
bool SetIcon(LPCWSTR lpszResourceName, uint32_t nWidth, uint32_t nHeight);
void SetBackroundBrush(HBRUSH brush);
private:
CBitmapPicture(const CBitmapPicture&);
CBitmapPicture& operator=(const CBitmapPicture&);
bool CBitmapPicture::SetBitmap(HBITMAP hBitmap);
int m_nResourceID;
std::wstring m_strResourceName;
uint32_t m_IconWidth, m_IconHeight;
bool m_ResourceIcon;
BITMAP m_bmInfo;
CBitmap m_hBitmap;
CBrush m_BackgroundBrush;
};

View File

@ -1,67 +0,0 @@
#include "wtl-ColorButton.h"
CColorButton::CColorButton() :
m_Red(0),
m_Green(0),
m_Blue(0)
{
memset(m_CustClr, 0, sizeof(m_CustClr));
}
LRESULT CColorButton::OnPaint(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL &/*bHandled*/)
{
CPaintDC dc(m_hWnd);
CRect rect;
GetClientRect(&rect);
CPen pen;
pen.CreatePen(PS_SOLID, 0, ::GetSysColor(COLOR_GRAYTEXT));
HPEN hpenOld = dc.SelectPen(pen);
CBrush PaintBrush;
PaintBrush.CreateSolidBrush(RGB(m_Red, m_Green, m_Blue));
dc.SelectBrush(PaintBrush);
dc.Rectangle(rect.left, rect.top, rect.Width(), rect.Height());
dc.SelectPen(hpenOld);
return 0;
}
void CColorButton::SetColor(uint8_t Red, uint8_t Green, uint8_t Blue)
{
m_Red = Red;
m_Green = Green;
m_Blue = Blue;
SendNotification(CPN_SELCHANGE);
Invalidate();
}
LRESULT CColorButton::OnClicked(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
CHOOSECOLOR cc = { 0 };
static DWORD rgbCurrent; // initial color selection
ZeroMemory(&cc, sizeof(cc));
cc.lStructSize = sizeof(cc);
cc.hwndOwner = GetParent();
cc.lpCustColors = (LPDWORD)m_CustClr;
cc.rgbResult = RGB(m_Red, m_Green, m_Blue);
cc.Flags = CC_FULLOPEN | CC_RGBINIT | CC_PREVENTFULLOPEN;
if (ChooseColor(&cc) == TRUE)
{
m_Red = GetRValue(cc.rgbResult);
m_Green = GetGValue(cc.rgbResult);
m_Blue = GetBValue(cc.rgbResult);
SendNotification(CPN_SELCHANGE);
}
return TRUE;
}
void CColorButton::SendNotification(UINT nCode)
{
NMCOLORBUTTON nmclr;
nmclr.hdr.code = nCode;
nmclr.hdr.hwndFrom = m_hWnd;
nmclr.hdr.idFrom = GetDlgCtrlID();
nmclr.clr = RGB(m_Red, m_Green, m_Blue);
::SendMessage(GetParent(), WM_NOTIFY, (WPARAM)GetDlgCtrlID(), (LPARAM)&nmclr);
}

View File

@ -1,39 +0,0 @@
#pragma once
#include "wtl.h"
#include <stdint.h>
class CColorButton :
public CWindowImpl <CColorButton>
{
public:
struct NMCOLORBUTTON
{
NMHDR hdr;
COLORREF clr;
};
enum
{
CPN_SELCHANGE = 0x8000, /* Colour Picker Selection change */
};
BEGIN_MSG_MAP(CColorButton)
REFLECTED_COMMAND_CODE_HANDLER(BN_CLICKED, OnClicked)
MESSAGE_HANDLER(WM_PAINT, OnPaint);
END_MSG_MAP()
CColorButton();
LRESULT OnPaint(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL &/*bHandled*/);
void SetColor(uint8_t Red, uint8_t Green, uint8_t Blue);
LRESULT OnClicked(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
inline uint8_t Red() const { return m_Red; }
inline uint8_t Green() const { return m_Green; }
inline uint8_t Blue() const { return m_Blue; }
private:
void SendNotification(UINT nCode);
COLORREF m_CustClr[16];
uint8_t m_Red, m_Green, m_Blue;
};

View File

@ -1,60 +0,0 @@
#include "wtl-OsdButton.h"
COSDButton::COSDButton(uint32_t IconId, DWORD dwExtendedStyle, HIMAGELIST hImageList) :
CBitmapButtonImpl<COSDButton>(dwExtendedStyle, hImageList),
m_Checked(false)
{
if (IconId != 0)
{
m_Icon.LoadIcon(IconId);
}
}
void COSDButton::DoPaint(CDCHandle dc)
{
CRect rect = { 0 };
GetClientRect(&rect);
COLORREF BackgroundColor = RGB(225, 225, 225);
COLORREF BorderColor = RGB(173, 173, 173);
if (!IsWindowEnabled())
{
BackgroundColor = RGB(204, 204, 204);
BorderColor = RGB(191, 191, 191);
}
else if (m_fMouseOver)
{
BackgroundColor = RGB(229, 241, 251);
BorderColor = RGB(0, 120, 215);
}
if (m_Checked)
{
BackgroundColor = RGB(204, 228, 247);
BorderColor = RGB(0, 84, 153);
}
CBrush Background;
Background.CreateSolidBrush(BackgroundColor);
CPen pen;
pen.CreatePen(PS_SOLID, 1, BorderColor);
dc.SelectPen(pen);
dc.SelectBrush(Background);
dc.Rectangle(rect.left, rect.top, rect.right, rect.bottom);
if (!m_Icon.IsNull())
{
uint32_t IconBorder = (uint32_t)(rect.Width() * 0.3);
uint32_t IconSize = rect.Width() - (IconBorder * 2);
dc.DrawIconEx(IconBorder, IconBorder, m_Icon, IconSize, IconSize);
}
}
void COSDButton::SetChecked(bool checked)
{
if (m_Checked != checked)
{
m_Checked = checked;
Invalidate();
}
}

View File

@ -1,19 +0,0 @@
#include "wtl.h"
#include <stdint.h>
class COSDButton :
public CBitmapButtonImpl<COSDButton>
{
public:
DECLARE_WND_SUPERCLASS(_T("WTL_BitmapButton"), GetWndClassName())
COSDButton(uint32_t IconId, DWORD dwExtendedStyle = BMPBTN_AUTOSIZE | BMPBTN_HOVER, HIMAGELIST hImageList = NULL);
void DoPaint(CDCHandle dc);
void SetChecked(bool checked);
inline bool isChecked(void) const { return m_Checked; }
private:
CIcon m_Icon;
bool m_Checked;
};

View File

@ -1,120 +0,0 @@
#include "wtl-OsdPreview.h"
#include "FontInfo.h"
#include "util/util.h"
#include "Language.h"
#include <DWrite.h>
#pragma comment(lib, "Dwrite.lib")
COsdPreview::COsdPreview() :
m_FontFile(L"arial.ttf"),
m_FontSize(16),
m_Red(0),
m_Green(0),
m_Blue(0)
{
}
void COsdPreview::SetFont(const std::wstring & FontFile)
{
m_FontFile = FontFile;
Invalidate();
}
void COsdPreview::SetFontSize(uint32_t FontSize)
{
m_FontSize = FontSize;
Invalidate();
}
void COsdPreview::SetColor(uint8_t Red, uint8_t Green, uint8_t Blue)
{
m_Red = Red;
m_Green = Green;
m_Blue = Blue;
Invalidate();
}
LRESULT COsdPreview::OnPaint(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL & /*bHandled*/)
{
CRect rect;
GetClientRect(&rect);
CPaintDC dc(m_hWnd);
CBrush PaintBrush;
PaintBrush.CreateSolidBrush(RGB(0, 0, 0));
dc.SelectBrush(PaintBrush);
dc.Rectangle(rect.left, rect.top, rect.Width(), rect.Height());
dc.SetTextColor(RGB(m_Red, m_Green, m_Blue));
dc.SetBkColor(RGB(0, 0, 0));
std::wstring fontFileName = ToUTF16(GetFontFolder().c_str());
fontFileName += L"\\" + m_FontFile;
AddFontResourceEx(fontFileName.c_str(), FR_PRIVATE, 0);
LOGFONT logFont;
if (SUCCEEDED(GetLogFontFromFileName(fontFileName.c_str(), &logFont)))
{
int desiredPpem = (int)m_FontSize;
logFont.lfHeight = -long(desiredPpem);
HFONT hf = CreateFontIndirect(&logFont);
HFONT hOldFont = (HFONT)dc.SelectFont(hf);
if (hOldFont)
{
dc.DrawText(wGS(OSD_PREVIEW).c_str(), -1, rect, DT_CENTER | DT_VCENTER | DT_SINGLELINE);
dc.SelectFont(hOldFont);
}
}
return 0;
}
HRESULT COsdPreview::GetLogFontFromFileName(const wchar_t * fontFileName, LOGFONT* logFont)
{
CComPtr<IDWriteFactory> dwriteFactory;
if (FAILED(DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED, __uuidof(IDWriteFactory), reinterpret_cast<IUnknown**>(&dwriteFactory))))
{
return S_FALSE;
}
CComPtr<IDWriteGdiInterop> gdiInterop;
if (FAILED(dwriteFactory->GetGdiInterop(&gdiInterop)))
{
return S_FALSE;
}
CComPtr<IDWriteFontFile> fontFile;
if (FAILED(dwriteFactory->CreateFontFileReference(fontFileName, nullptr, &fontFile)))
{
return S_FALSE;
}
BOOL isSupportedFontType = false;
DWRITE_FONT_FILE_TYPE fontFileType;
DWRITE_FONT_FACE_TYPE fontFaceType;
UINT32 numberOfFaces = 0;
if (FAILED(fontFile->Analyze(&isSupportedFontType, &fontFileType, &fontFaceType, &numberOfFaces)))
{
return S_FALSE;
}
if (!isSupportedFontType)
{
return DWRITE_E_FILEFORMAT;
}
CComPtr<IDWriteFontFace> fontFace;
IDWriteFontFile * const fontFiles[] =
{
fontFile.p
};
if (FAILED(dwriteFactory->CreateFontFace(fontFaceType, ARRAYSIZE(fontFiles), &fontFiles[0], 0, DWRITE_FONT_SIMULATIONS_NONE, &fontFace)))
{
return S_FALSE;
}
if (FAILED(gdiInterop->ConvertFontFaceToLOGFONT(fontFace, OUT logFont)))
{
return S_FALSE;
}
return S_OK;
}

View File

@ -1,25 +0,0 @@
#pragma once
#include "wtl.h"
#include <string>
class COsdPreview :
public CWindowImpl <COsdPreview>
{
public:
BEGIN_MSG_MAP(CColorButton)
MESSAGE_HANDLER(WM_PAINT, OnPaint);
END_MSG_MAP()
COsdPreview();
void SetFont(const std::wstring & FontFile);
void SetFontSize(uint32_t FontSize);
void SetColor(uint8_t Red, uint8_t Green, uint8_t Blue);
LRESULT OnPaint(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL & /*bHandled*/);
private:
static HRESULT GetLogFontFromFileName(const wchar_t * fontFileName, LOGFONT* logFont);
std::wstring m_FontFile;
uint8_t m_Red, m_Green, m_Blue;
uint32_t m_FontSize;
};

View File

@ -1,97 +0,0 @@
#pragma once
#include "wtl.h"
// Wrapper for the Win32 LOGFONT structure
class CLogFont : public LOGFONT
{
public:
CLogFont()
{
memset(static_cast<LOGFONT*>(this), 0, sizeof(LOGFONT));
}
};
// Class used to create a font based on the font used by a specific window
class CWindowFont : public CFont
{
public:
// Font styles
typedef enum tagEType
{
typeNormal = 0x00,
typeBold = 0x01,
typeItalic = 0x02,
typeUnderline = 0x04,
typeSubheading = 0x08,
typeHeading = 0x10,
} EType;
public:
CWindowFont() : CFont()
{
}
/// hWnd - The window to use for the base font
/// nType - Font style flags
CWindowFont(HWND hWnd, int nType)
{
// We need a HWND
ATLASSERT(hWnd != NULL);
// Create the font
Create(hWnd, nType);
}
virtual ~CWindowFont()
{
}
public:
// Create the font
// hWnd - The window to use for the base font
// nType - Font style flags
// return true on success
bool Create(HWND hWnd, int nType)
{
// Be defensive
ATLASSERT(hWnd != NULL);
ATLASSERT(::IsWindow(hWnd) != FALSE);
// Get the font the window is currently using
HFONT hFont = (HFONT)::SendMessage(hWnd, WM_GETFONT, 0, 0);
// Do we have a font?
if (hFont == NULL)
return false;
::CLogFont lf;
// Fill the LOGFONT
if (::GetObject(hFont, sizeof(lf), &lf) == 0)
return false;
// Amend the LOGFONT members
if (nType & typeBold)
lf.lfWeight = FW_BOLD;
if (nType & typeItalic)
lf.lfItalic = TRUE;
if (nType & typeUnderline)
lf.lfUnderline = TRUE;
if (nType & typeSubheading)
lf.lfHeight = static_cast<LONG>(lf.lfHeight * 1.25);
if (nType & typeHeading)
lf.lfHeight = static_cast<LONG>(lf.lfHeight * 2.5);
// Create the new font
return CreateFontIndirect(&lf) ? true : false;
}
// Create the font and apply to a nominate dialog control
bool Apply(HWND hWnd, int nType, UINT nControlID)
{
// First create the font
if (IsNull() && !Create(hWnd, nType))
{
return false;
}
// Apply to the nominated control
CWindow wndControl = ::GetDlgItem(hWnd, nControlID);
ATLASSERT(wndControl != NULL);
// Apply
wndControl.SetFont(m_hFont);
return true;
}
};

View File

@ -1,113 +0,0 @@
#pragma once
template < class T, class TT = CToolTipCtrl >
class CToolTipDialog
{
// Data declarations and members
public:
TT& GetTT() { return m_TT; }
protected:
TT m_TT;
UINT m_uTTStyle;
UINT m_uToolFlags;
// Construction
CToolTipDialog(UINT uTTSTyle = TTS_NOPREFIX | TTS_BALLOON, UINT uToolFlags = TTF_IDISHWND | TTF_SUBCLASS)
: m_TT(NULL), m_uTTStyle(uTTSTyle),
m_uToolFlags(uToolFlags | TTF_SUBCLASS)
{}
void TTInit()
{
T* pT = (T*)this;
ATLASSERT(::IsWindow(*pT));
m_TT.Create(*pT, NULL, NULL, m_uTTStyle);
CToolInfo ToolInfo(pT->m_uToolFlags, *pT, 0, 0, MAKEINTRESOURCE(pT->IDD));
m_TT.AddTool(&ToolInfo);
::EnumChildWindows(*pT, SetTool, (LPARAM)pT);
TTDelay();
TTSize(0);
TTActivate(TRUE);
}
// Operations
public:
void TTActivate(BOOL bActivate)
{
m_TT.Activate(bActivate);
}
void TTSize(int nPixel)
{
m_TT.SetMaxTipWidth(nPixel);
}
void TTDelay()
{
m_TT.SetDelayTime(TTDT_INITIAL, 1250);
m_TT.SetDelayTime(TTDT_RESHOW, 600);
m_TT.SetDelayTime(TTDT_AUTOPOP, 32767);
}
void TTSetTxt(HWND hTool, _U_STRINGorID text)
{
m_TT.UpdateTipText(text, hTool);
}
void TTSetTxt(UINT idTool, _U_STRINGorID text)
{
TTSetTxt(GetHWND(idTool), text);
}
BOOL TTAdd(HWND hTool)
{
return SetTool(hTool, (LPARAM)(T*)this);
}
BOOL TTAdd(UINT idTool)
{
return TTAdd(GetHWND(idTool));
}
void TTRemove(HWND hTool)
{
m_TT.DelTool(hTool);
}
void TTRemove(UINT idTool)
{
TTRemove(GetHWND(idTool));
}
// Message map and handlers
BEGIN_MSG_MAP(CToolTipDialog)
MESSAGE_RANGE_HANDLER(WM_MOUSEFIRST, WM_MOUSELAST, OnMouse)
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
END_MSG_MAP()
LRESULT OnInitDialog(UINT, WPARAM, LPARAM, BOOL& bHandled)
{
TTInit();
bHandled = FALSE;
return TRUE;
}
LRESULT OnMouse(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)
{
T* pT = (T*)this;
bHandled = FALSE;
if (m_TT.IsWindow())
m_TT.RelayEvent((LPMSG)pT->GetCurrentMessage());
return 0;
}
// Implementation
private:
HWND GetHWND(UINT idTool)
{
return ::GetDlgItem(*(T*)this, idTool);
}
static BOOL CALLBACK SetTool(HWND hTool, LPARAM pDlg)
{
T* pT = (T*)pDlg;
auto idTool = ::GetWindowLong(hTool, GWL_ID);
if (idTool != IDC_STATIC)
{
CToolInfo ToolInfo(pT->m_uToolFlags, hTool, 0, 0, (LPTSTR)idTool);
pT->m_TT.AddTool(&ToolInfo);
}
return TRUE;
}
};

View File

@ -1,21 +0,0 @@
#pragma once
#undef OS_WINDOWS
#pragma warning(push)
#pragma warning(disable : 4091) // warning C4091: 'typedef ': ignored on left of 'tagGPFIDL_FLAGS' when no variable is declared
#pragma warning(disable : 4201) // warning C4201: nonstandard extension used: nameless struct/union
#pragma warning(disable : 4302) // warning C4302: 'type cast': truncation from 'LPCTSTR' to 'WORD'
#pragma warning(disable : 4458) // warning C4458: declaration of 'dwCommonButtons' hides class member
#pragma warning(disable : 4838) // warning C4838: conversion from 'int' to 'UINT' requires a narrowing conversion
#pragma warning(disable : 4996) // warning C4996: 'GetVersionExA': was declared deprecated
#define _ATL_DISABLE_NOTHROW_NEW
#include <atlbase.h>
#include "wtl\atlapp.h"
#include "wtl\atlcrack.h"
#include "wtl\atlctrls.h"
#include "WTL\atlctrlx.h"
#include "WTL\atlgdi.h"
#include "WTL\atlmisc.h"
#include "WTL\atlwinx.h"
#include <atlwin.h>
#pragma warning(pop)

View File

@ -1,21 +0,0 @@
#include "AboutDialog.h"
#include "ui_AboutDialog.h"
#include <QPushButton>
#include <QDialogButtonBox>
AboutDialog::AboutDialog(QWidget *parent, Qt::WindowFlags f) :
QDialog(parent, f),
ui(new Ui::AboutDialog)
{
ui->setupUi(this);
}
AboutDialog::~AboutDialog()
{
delete ui;
}
void AboutDialog::_init()
{
ui->buttonBox->button(QDialogButtonBox::Close)->setText(tr("Close"));
}

View File

@ -1,23 +0,0 @@
#ifndef ABOUTDIALOG_H
#define ABOUTDIALOG_H
#include <QDialog>
namespace Ui {
class AboutDialog;
}
class AboutDialog : public QDialog
{
Q_OBJECT
public:
explicit AboutDialog(QWidget *parent = Q_NULLPTR, Qt::WindowFlags f = Qt::WindowFlags());
~AboutDialog();
private:
void _init();
Ui::AboutDialog *ui;
};
#endif // ABOUTDIALOG_H

View File

@ -1,615 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>AboutDialog</class>
<widget class="QDialog" name="AboutDialog">
<property name="windowModality">
<enum>Qt::WindowModal</enum>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>339</width>
<height>378</height>
</rect>
</property>
<property name="windowTitle">
<string>About GLideN64</string>
</property>
<property name="windowIcon">
<iconset resource="icon.qrc">
<normaloff>:/Icon.ico</normaloff>:/Icon.ico</iconset>
</property>
<property name="modal">
<bool>true</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<property name="sizeConstraint">
<enum>QLayout::SetFixedSize</enum>
</property>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="spacing">
<number>10</number>
</property>
<item>
<widget class="QLabel" name="label_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string notr="true">&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;img width=&quot;48&quot; height=&quot;48&quot; src=&quot;:/Icon.ico&quot;/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_4">
<property name="font">
<font>
<pointsize>20</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string notr="true">GLideN64</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="minimumSize">
<size>
<width>0</width>
<height>275</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>275</height>
</size>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
<string>About</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_4">
<property name="spacing">
<number>12</number>
</property>
<item>
<spacer name="verticalSpacer_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_5">
<property name="text">
<string>The next generation open source graphics plugin for N64 emulators.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Authors</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_9">
<item>
<widget class="QLabel" name="label_3">
<property name="font">
<font>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string notr="true">Sergey Lipskiy</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_19">
<property name="text">
<string>Developer</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label">
<property name="font">
<font>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string notr="true">Olivieryuyu</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_21">
<property name="text">
<string>Beta tester</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_13">
<property name="font">
<font>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string notr="true">Ryan Rosser</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_15">
<property name="text">
<string>GUI designer</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_3">
<attribute name="title">
<string>Contributors</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<widget class="QScrollArea" name="scrollArea_2">
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents_2">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>278</width>
<height>356</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="label_17">
<property name="text">
<string notr="true">&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Logan McNaughton&lt;/p&gt;&lt;p&gt;Francisco Zurita&lt;/p&gt;&lt;p&gt;gizmo98&lt;/p&gt;&lt;p&gt;purplemarshmallow&lt;/p&gt;&lt;p&gt;zilmar&lt;/p&gt;&lt;p&gt;matthewharvey&lt;/p&gt;&lt;p&gt;lioncash&lt;/p&gt;&lt;p&gt;Predator82Germany&lt;/p&gt;&lt;p&gt;AmbientMalice&lt;/p&gt;&lt;p&gt;baptiste0602&lt;/p&gt;&lt;p&gt;Gilles Siberlin&lt;/p&gt;&lt;p&gt;Daniel Eck&lt;/p&gt;&lt;p&gt;Víctor &amp;quot;IlDucci&amp;quot;&lt;/p&gt;&lt;p&gt;orbea&lt;/p&gt;&lt;p&gt;BenjaminSiskoo&lt;/p&gt;&lt;p&gt;ptitSeb&lt;/p&gt;&lt;p&gt;Kimberly J. Ortega&lt;/p&gt;&lt;p&gt;Maxime Morel&lt;/p&gt;&lt;p&gt;tony971&lt;/p&gt;&lt;p&gt;SigmaVirus&lt;/p&gt;&lt;p&gt;Jools Wills&lt;/p&gt;&lt;p&gt;Nekokabu&lt;/p&gt;&lt;p&gt;nicklauslittle&lt;/p&gt;&lt;p&gt;Nebuleon&lt;/p&gt;&lt;p&gt;sergiobenrocha2&lt;/p&gt;&lt;p&gt;Michał Durak&lt;/p&gt;&lt;p&gt;Mushman&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_2">
<attribute name="title">
<string>Funders</string>
</attribute>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<property name="spacing">
<number>18</number>
</property>
<item>
<layout class="QVBoxLayout" name="verticalLayout_6">
<item>
<widget class="QLabel" name="label_9">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string notr="true">zolcos
Mush Man
nesplayer4life
neko9876
AnthonyHeathcoat
daman6009
Paul Lamb
zilmar</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<widget class="QScrollArea" name="scrollArea">
<property name="widgetResizable">
<bool>false</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>147</width>
<height>1649</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_8">
<item>
<widget class="QLabel" name="label_23">
<property name="text">
<string notr="true">Ryan Rosser
Amadeus Sterl
Narann
camara_luiz
weinerschnitzel
microdev
Thomas Ginelli
ace977
patryk.szalanski
Detomine
itasovski
keithclark1985
josephrmoore
fckyourlies
dougforr
camdenfurse
grandslam810
rictic
Fred Lambes
David Vercruyssen
danielgormly
lukecool
rhilsky
phillipstuerzl
killjoy1337
ratop46
william.a.moore
RSP16
kzidek127
Dan Holberg
178amm
peterchrjoergensen
hill_jm
petercullenbryan
Christopher M Rock
Kenny.R.Mitchell
Kevin Grasso
mtgyure
Anthony Heathcoat
Liam Burns
Steven Impson
Gwyn.Whieldon
hipnotoad
shmuklidooha
bcanard123
Ben Slater
Mike Nagy
littlegreendude55
Jay Loring
Damion D
heranbago
baptiste.guilbert
shadowpower69
j.mcguirk72
Peter Greenwood
fla56
Sergio
theboy_181
Jindo Fox
s1n.pcc
rafaelvasco
copileo
hugues.fabien
seanmcm157
David Morris
Jason Lightner
olivier_crepin77
Paul Lamb
thegump2.0
Bates
cdoublejj
buddybenj
don.carmical
kyussgreen
info1092
YQ
Allan Nordhøy
christian010
creuseur2patateradio
chrisbevanlee
theschklingen
Thomas Lindstrøm
Djipi
Dartus
Oscar Abraham
nwstrathdee
will7046
Richard42
V1del
AnthonyBentley
buddybenj
nickshooter251
sicurella12
jcspringer
Gru So
Vinícius dos Santos Oliveira
Jimmy Haugh
Malcolm
Alex Strange
Espen Jensen
m.johnsondelta
alexzandar.toxic2
Ben Slater
WC-Predator
Mush Man
Ben Slater
aznlucidx
Nathan Dick
paulanocom
Ryan Rosser
nekow42
mgos1
ian.macdonald996
itasovski
vikingpower1
DukeX007X
palaciosgabriel
Franz-Josef Haider
e-male
aweath
famicom4
Keith_at_UMR
sweatypickle
jeremydmiller</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_24">
<property name="text">
<string extracomment="Refers to more funders">... and more</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_4">
<attribute name="title">
<string>Credits</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QLabel" name="label_14">
<property name="font">
<font>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string notr="true">Orkin</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_27">
<property name="text">
<string>Author of the original glN64 graphics plugin</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_16">
<property name="font">
<font>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string notr="true">yongzh</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_28">
<property name="text">
<string>Author of gles2n64, a port of glN64 to GL ES 2.0</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_18">
<property name="font">
<font>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string notr="true">Hiroshi Morii</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_25">
<property name="text">
<string>Author of the GlideHQ texture library</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_20">
<property name="font">
<font>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string notr="true">ziggy</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_29">
<property name="text">
<string>Author of z64, an OpenGL LLE plugin</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Close</set>
</property>
</widget>
</item>
</layout>
</widget>
<resources>
<include location="icon.qrc"/>
</resources>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>AboutDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>257</x>
<y>414</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>AboutDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>325</x>
<y>414</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>

Some files were not shown because too many files have changed in this diff Show More